Add “Delete on Reboot” to Right Click Menu

By jbayer - Last updated: Wednesday, October 2, 2013 - Save & Share - Leave a Comment

Horrors!  I’m actually talking about Windows.

I use Windows for my desktop, because my company uses a number of Windows-based products which we (the sysops team) also need to use.

I recently tried to delete a file which was in use.  So I hunted around and found the following code.  Please note that I did NOT write this, but am putting it here as a reference and documentation.  The original site where I got this from is:  Add Delete on Reboot

He says that this is for XP Home, Pro, and Win2K, but it also seemed to work on Windows 7.

Backup your registry first!!!

 

Open notepad, and copy/paste the text below. Save the file as whatever.reg
Double clicking the whatever.reg file will add it to the registry, and give you the option to: “Delete on Reboot” when you right click a file or folder.

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\""
Posted in Desktop, Windows • Tags: Top Of Page
368 views

Write a comment

asd