Skip to content

trfi/lockdown-restore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lockdown-restore

Restore Windows policy lockdowns for Task Manager, Shutdown, and Log Off - disabled by kiosk, exam, or parental-control software.

License: MIT Platform: Windows Built with Rust

lockdown-restore in action


What it does

Kiosk and exam-management software (e.g. Safe Exam Browser, MDM profiles, GPO scripts, parental-control tools) lock the Windows shell by writing policy values to the registry. When the session ends, these values are sometimes not cleaned up, leaving the user unable to:

  • Open Task Manager (Ctrl+Shift+Esc)
  • Shut down or restart the computer
  • Log off / sign out

lockdown-restore detects and deletes these four registry values, restoring normal Windows behaviour:

Feature Registry hive Key Value
Task Manager HKCU ...\Policies\System DisableTaskMgr
Log Off / Sign Out HKCU ...\Policies\Explorer NoLogoff
Shutdown / Power HKCU ...\Policies\Explorer NoClose
Shutdown / Power (machine) HKLM ...\Policies\Explorer NoClose

The full key path is Software\Microsoft\Windows\CurrentVersion\Policies\...


Usage

Just double-click lockdown-restore.exe.

A console window opens, runs the restore, prints a status table, and waits for you to press Enter before closing.

  Lockdown Restore v0.1.0
  ────────────────────────────────────────────────────────────────────────
  Status    Feature                                    Detail
  ────────────────────────────────────────────────────────────────────────
  [OK]      Task Manager                               restored  (was DisableTaskMgr=1)
  [OK]      Log Off / Sign Out                         restored  (was NoLogoff=1)
  [SKIP]    Shutdown (user policy)                     already enabled
  [OK]      Shutdown (machine policy, needs Admin)     restored  (was NoClose=1)
  ────────────────────────────────────────────────────────────────────────

  [+] Done! Windows restrictions have been lifted.
      Sign out and back in if the changes don't appear immediately.

  Press Enter to exit...

Status codes

Code Meaning
[OK] Value was found and successfully deleted
[SKIP] Value was not set - nothing to do
[FAIL] Could not delete - usually requires Administrator

Running as Administrator (recommended)

The machine-wide HKLM shutdown policy requires elevated privileges. To restore everything:

  1. Right-click lockdown-restore.exe
  2. Choose Run as Administrator

Download

Download the latest pre-built .exe from the Releases page.

No installation - single standalone executable, no runtime dependencies.


Build from source

Prerequisites: Rust toolchain (stable, Windows target)

git clone https://github.com/trfi/lockdown-restore
cd lockdown-restore
cargo build --release
# Binary: target\release\lockdown-restore.exe

Known software that applies these lockdowns

Software Task Mgr Log Off Shutdown
Safe Exam Browser (SEB)
Windows MDM / Intune kiosk mode
Group Policy (GPO) kiosk profile
NetSupport School
Parental controls (various)

If a tool you use isn't listed but sets these same registry values, lockdown-restore will still work.


How it works

lockdown-restore uses the Windows Registry API (RegOpenKeyExW, RegDeleteValueW) to delete the policy values rather than setting them to 0. Deletion is preferred because it leaves no trace of the restriction - the OS behaves as if the policy never existed.

HKEY_CURRENT_USER
└── Software\Microsoft\Windows\CurrentVersion\Policies
    ├── System
    │   └── DisableTaskMgr   ← deleted
    └── Explorer
        └── NoLogoff         ← deleted
        └── NoClose          ← deleted

HKEY_LOCAL_MACHINE
└── Software\Microsoft\Windows\CurrentVersion\Policies
    └── Explorer
        └── NoClose          ← deleted (requires Admin)

Project structure

src/
  main.rs      - entry point: run restores, print table, pause
  restore.rs   - one function per Windows feature (task mgr, logoff, shutdown)
  registry.rs  - low-level Win32 registry helpers (read_dword, delete_value)

FAQ

Q: Do I need to be an Administrator?
A: For the three HKCU keys - no. For the HKLM machine-wide shutdown key - yes. The tool runs either way and reports which keys it could not access.

Q: Will this affect anything else on my system?
A: No. It only touches the four specific policy values listed above and does not modify any other settings.

Q: The changes didn't take effect immediately.
A: Sign out and sign back in (or restart Explorer) for policy changes to fully apply. Task Manager is usually available immediately.

Q: Is it safe to run while the locking software is still active?
A: The restore will work, but the locking software may re-apply the restrictions. Run this tool after the locking software has exited for best results.


License

MIT - see LICENSE.


Contributing

Issues and pull requests are welcome. If you find a tool that uses different registry keys to lock the same features, please open an issue with the key path and value name so support can be added.

About

Restore Windows policy lockdowns for Task Manager, Shutdown, and Log Off - disabled by kiosk, exam, or parental-control software.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages