I've been looking for the most convenient way to tell Windows 10 to delete certain files upon rebooting. Having a right-click context menu option seems to be the most efficient solution. I've stumbled across the following registry entries that give me such an option, but on Windows 10 x64 it isn't actually deleting the files I apply it to.
[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\""
Apparently this registry code has been floating around the internet for a long time, and the most updated information I could find about it was someone saying that it worked for them on Windows 7. Is there some way I can modify it to work on Windows 10?
Thank you.