I want to delete a large number of files from a USB hard drive, I found that a faster way to delete is to use the cmd console delete function. I would like to add the option to do this into the context menus for files and for folders.
I found this tutorial that shows to create a .bat file and add it to the registry, however when I try to use it nothing happens, I did manage to get the option to appear in the context menu by adding the key to Computer\HKEY_CLASSES_ROOT*\shell\Fast Delete\command instead of the Computer\HKEY_CLASSES_ROOT\Directory\shell\Fast Delete\command like it says in the tutorial, although when I try to use it from the right click nothing happens.
The .bat file is as follows:
@ECHO OFF
ECHO Delete Folder: %CD%?
PAUSE
SET FOLDER=%CD%
CD /
DEL /F/Q/S "%FOLDER%" > NUL
RMDIR /Q/S "%FOLDER%"
EXIT
and the location of the .bat file is "C:\Extra Windows Tools\delete.bat" i did add **"C:\Extra Windows Tools** to the system path variable.
I have tried using cmd /c "cd %1 && delete.bat" like the tutorial says and nothing happens I have also tried "C:\Extra Windows Tools\delete.bat" %1, that I found on another website.
Any help that you can give will be greatly appreciated
*Edit 1 The problem is partly to do with permissions and partly because it doesnt seem to work when i right click on folders only on files. with the permissions problems i go through these steps which allows me to delete files using the normal delete option but not with the batch script.
*Edit 2 - I have sorted the permissions, the problem is because the script doesnt seem to work on folders
*Edit 3 - I have fixed the problem, i added the key with the suggestion below to Computer\HKEY_CLASSES_ROOT\Directory\shell\Fast Delete and it now works on folders. Thank you for all your suggestions
pause
? – Scott Mar 2 '18 at 18:56Restart
, notShut down
, as with default settings this hibernates, which doesn't restart anything. – AFH Mar 2 '18 at 19:19