Page 1 of 1

Add "Delete on Reboot" to Right Click Menu

Posted: Fri Feb 18, 2005 12:22 pm
by Norm
Delete those pesky files, and folders that don't want to go.

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.

Code: Select all

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\""

Should work with XP Home, Pro, and Win2K
Backup your registry first!!!

I found this online somewhere, but can't remember where.
I wanted to give credit to the author, but can't find the original thread it was in.
[edit] Found the thread it was in Here

I've tried it here on XP Pro, and it works well.

Posted: Fri Feb 18, 2005 12:39 pm
by Prey521
n/m :)


Gonna try it now for my home PC, I have a similar app that does this now, but doesn't work very well, thanks for the linkage.

Posted: Fri Feb 18, 2005 2:26 pm
by Sid
Great find there Norm. Thanks for the code

Posted: Fri Feb 18, 2005 2:49 pm
by Norm
This will take care of most pesky files or folders, but not all, in all cases.

Since the file gets deleted 'after' a user logs on, it IS possible the file will already be "in use" by the system, or another process, and access is denied.

Also, some pesky files are recreated by another process (usually, but not always, viral) and will reappear even if deleted.

Good for most though.....

Posted: Fri Feb 18, 2005 5:35 pm
by morbidpete
thats a whole bunch norm..had 2 folders on ym hdd that were empty and wouldnt deleat no matter what....this took care of them..awsome!

Posted: Fri Feb 18, 2005 5:52 pm
by YeOldeStonecat
Heehee...oh the pranks that can be pulled with this one. :D

Posted: Fri Feb 18, 2005 5:56 pm
by ColdFusion
Sweet! Great find there norm!

Posted: Fri Feb 18, 2005 6:16 pm
by The Dude
Great find, Norm! :thumb:

Posted: Fri Feb 18, 2005 8:44 pm
by Prey521
How do you UNDO an accidental Delete on Reboot?

Posted: Fri Feb 18, 2005 9:47 pm
by ColdFusion
In the registry browse to:
HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\Currentversion\\RunOnce

and delete the entry that has something along the lines of Del <file> OnNextReboot\

I dont think you are ... but if you are asking how to undelete after the file has already been deleted then im not sure. Probibaly need some sort of file recovery software.

Posted: Fri Feb 18, 2005 11:22 pm
by The Dude
Check the recycle bin to see if it ended up there.

Posted: Tue Mar 08, 2005 7:42 pm
by ghost
Thanks Norm, a case just came up today where I may need such a tool. :thumb:

Posted: Fri Mar 11, 2005 7:36 pm
by AMPLIFRIER
NO DOUBT!!!!!

that is such an awesome menu item to have!!!!!

sweet

AMP

Posted: Thu Mar 17, 2005 4:19 pm
by striker8000
Prey521 wrote:How do you UNDO an accidental Delete on Reboot?
if it isn't in the recycle bin...file recovery software

it should be a simple name change (to mark as deleted until the space is needed), and a simple search to relocate the file....google isn't showing anything interesting yet

Posted: Thu Mar 17, 2005 4:25 pm
by Prey521
striker8000 wrote:if it isn't in the recycle bin...file recovery software
Thx, ColdFusion answered it for me.

Posted: Sat Mar 19, 2005 9:03 am
by Jamie_R
Thanks Norm :thumb:

Posted: Tue Jul 15, 2008 1:15 pm
by mfcdsmfcds
I wanted to remove this thing. I added it to my pc, but I think it isn't working. I'm on vista home premium and it doesn't work. please help :D

Posted: Sun Oct 19, 2008 7:35 pm
by Watch5869
Norm wrote:Delete those pesky files, and folders that don't want to go.

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.

Code: Select all

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\""

Should work with XP Home, Pro, and Win2K
Backup your registry first!!!

I found this online somewhere, but can't remember where.
I wanted to give credit to the author, but can't find the original thread it was in.
[edit] Found the thread it was in Here

I've tried it here on XP Pro, and it works well.

I tried this but get an error message: "Cannot Import [Path] [filename] The specified file is not a registry script. You can only import binary registry files from within the registry editor"

did I do something wrong?

Posted: Mon Oct 20, 2008 6:15 pm
by CableDude
Watch5869 wrote:I tried this but get an error message: "Cannot Import [Path] [filename] The specified file is not a registry script. You can only import binary registry files from within the registry editor"

did I do something wrong?
What OS?

Posted: Mon Oct 20, 2008 7:23 pm
by Watch5869
CableDude wrote:What OS?
Win XP Home

Posted: Sat Nov 01, 2008 11:17 am
by ghettoside
Watch5869 wrote:I tried this but get an error message: "Cannot Import [Path] [filename] The specified file is not a registry script. You can only import binary registry files from within the registry editor"

did I do something wrong?
are you sure you saved it as a .reg file and not a .txt?

open the notepad file you created. from drop down menu, "save as", then select "all files" type, and then add ".reg" to the file name. close up the file, then you should have the original txt and a new reg file.

btw, you can also change file extensions by changing your folder options to show file extensions.

tools>folder options>view>hide extensions for known file types

uncheck that box and you can see & edit extensions.

Posted: Sat Apr 06, 2013 8:53 pm
by coolpc
how to undo this?

Posted: Sat Apr 06, 2013 8:53 pm
by coolpc
help! I want to undo this