sixpack Posted January 19, 2005 Posted January 19, 2005 hithis is what i want to doA right context menu option to delete a folder ad next rebootthis is what i have sofare:[HKEY_CLASSES_ROOT\Directory\shell\delete]@="Delete bij volgende Start"[HKEY_CLASSES_ROOT\Directory\shell\delete\command]@="dell.bat \"1%\""the bat file:REG ADD "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce" /V Cleanup /D "cmd.exe /C RD *.* /S /Q"in the bat file, if you use it this way i know i must specify a folder to delete itthe question:is there a command to use it on all folders, not just 1 question 2:the same option to delete a filethanks for reading this
Martin Zugec Posted January 19, 2005 Posted January 19, 2005 U should do this by PFR - Pending File Rename...
prathapml Posted January 19, 2005 Posted January 19, 2005 soulin, more details please. sixpack, what I can tell is that %CD% refers to current directory, and %%1 refers to current file. Hoping that hint helps You can try making your .BAT based on that info. And what do you mean by "all folders" ? Do you mean to say all folders within that folder? If so, use recursive folder removal ("rd /?" for help).
sixpack Posted January 19, 2005 Author Posted January 19, 2005 @prathapmlwith all folders i meandelete a folder on the desktopand delete a folder in lets say windowsso delete the folder with every thing in itdo you have a example on how to use the %CD% and %%1have tryed every command i know and it still doesend work
MCT Posted January 20, 2005 Posted January 20, 2005 .reg[HKEY_CLASSES_ROOT\Folder\Shell\Delete on Reboot\Command]@="Delfolder.cmd \"%1\"".cmdset Dir2Del=%1REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Currentversion\RunOnce /v DelOnNextReboot /d "cmd.exe /c RD /S /Q %Dir2Del%"havent tested it but i think it should work
sixpack Posted January 20, 2005 Author Posted January 20, 2005 well i guess i f***tup the registerymy option delete for folders is gone [the windows one]glad it's the test pcedit: fixed
MCT Posted January 20, 2005 Posted January 20, 2005 i tested it too, i get "too many commandline parameters" or something like that, it cant figure it out, cuz the directory is set
sixpack Posted January 20, 2005 Author Posted January 20, 2005 suppose this will work, then you can only delete 1 folderthe code must be for multiepul foldersand must work to on filesmy guess is it cant be doneor there must be a dll someware that can do all thisbut give up, NEVER
Martin Zugec Posted January 20, 2005 Posted January 20, 2005 Sorry for late response: about PFR, try to download tools like alter.exe or similar and look to registry changes they made...- U can add files to copy during boot sequention- U can add files to delete during boot sequention- U can delete all pending operation (but I dont recommend this)PFR is also used for installing hotfixes (e.g. only newest version of files will be copied).
Acheron Posted January 21, 2005 Posted January 21, 2005 This one works:DeleteFolderonReboot.regWindows Registry Editor Version 5.00[HKEY_CLASSES_ROOT\Folder\shell\Delete on reboot\command]@="delfolder.cmd \"%1\""Delfolder.cmd@echo offsetlocalset pathwithquotes=%1set originalpath=%pathwithquotes:~1,-1%REG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Currentversion\RunOnce /v "Del %originalpath% OnNextReboot" /d "cmd.exe /c RD /S /Q \"%originalpath%\"" /fendlocalDelfolder goes into windir or system32.EDIT: Fixed this with faster code
sixpack Posted January 21, 2005 Author Posted January 21, 2005 This one works:Delfolderonnextrebootextension.regWindows Registry Editor Version 5.00[HKEY_CLASSES_ROOT\Folder\shell\Delete on reboot\command]@="CMD.exe /C start /B /wait /D\"%1\" delfolder.cmd"Delfolder.cmd@echo offCMDOW @ /HIDREG ADD HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Currentversion\RunOnce /v "Del %cd% OnNextReboot" /d "cmd.exe /c RD /S /Q \"%cd%\"" /fEXITDelfolder goes into windir or system32.BTW, why do you need this feature???i allway's have files/folders that are in useto mutch digging around in windows i guess i will test it when i get homethanks for the reply
sixpack Posted January 21, 2005 Author Posted January 21, 2005 reply, it's an reply well sorry. old dude herei know my english is bad, sorry for this
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now