Delete on Reboot Right Click

· Windows Registry

Here is a powerful one. If you have a file that you cannot delete because Windows says, “The file is currently in use.” Use the script below and then right click on the file of target and click “Del OnNextReboot”. The file will be gone (hopefully) when you restart the computer.

Place the below in *.REG file and double click to add it to your right click menu.

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\Delete on reboot\command]
@="CMD /E:OFF /C REG ADD HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\Currentversion\\RunOnce /v \"Del %1 OnNextReboot\" /d ^\"cmd.exe /c DEL /F /Q \\\"%1\\\"\" /f\""

[HKEY_CLASSES_ROOT\*\shell\Open]

[HKEY_CLASSES_ROOT\Folder\shell\Delete on reboot\command]
@="CMD /E:OFF /C REG ADD HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\Currentversion\\RunOnce /v \"Del %1 OnNextReboot\" /d ^\"cmd.exe /c RD /S /Q \\\"%1\\\"\" /f\""

Source: http://forums.speedguide.net/showthread.php?172398-Add-quot-Delete-on-Reboot-quot-to-Right-Click-Menu

author image

About Joseph Spurrier

I'm passionate about building solutions to automate tasks and improve efficiency. Tech guy. Traveler. Runner. Guitar player. Scotch and beer enthusiast. Keybase GitHub Gists LinkedIn Twitter

Share this post


Comments powered by Disqus