Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I would like to add a new "Delete" context menu item such that I can delete large amounts of files and folders with a single right click without using explorer because of how slow it is. I have already made such an item using the following reg file:

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\delas]
@="DeleteCMD"
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\*\shell\delas\command]
@="cmd.exe /c del /f/s/q \"%1\" > nul & rmdir /s/q \"%1\" "
"IsolatedCommand"="cmd.exe /c del /f/s/q \"%1\" > nul & rmdir /s/q \"%1\" "

[HKEY_CLASSES_ROOT\Directory\shell\delas]
@="DeleteCMD"
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\Directory\shell\delas\command]
@="cmd.exe /c del /f/s/q \"%1\" > nul & rmdir /s/q \"%1\" "
"IsolatedCommand"="cmd.exe /c del /f/s/q \"%1\" > nul & rmdir /s/q \"%1\" "

It uses "del and "rmdir" to delete the files and/or folders, which works fine, except that it pops up a shell window.

I would like to know three things:

  1. Is there any way to change the above code such that a shell window does not pop up?
  2. Is there any way to replace Window's built in context menu "Delete" function with the above code?
  3. Is this the best way to go about this?

Update:

I figured out how to suppress the shell window by installing nircmd (make sure to add it to the windows directory first):

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\delas]
@="DeleteCMD"
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\*\shell\delas\command]
@="nircmd.exe exec hide cmd.exe /c del /f/s/q \"%1\" > nul & rmdir /s/q \"%1\" "
"IsolatedCommand"="nircmd.exe exec hide cmd.exe /c del /f/s/q \"%1\" > nul & rmdir /s/q \"%1\" "

[HKEY_CLASSES_ROOT\Directory\shell\delas]
@="DeleteCMD"
"NoWorkingDirectory"=""

[HKEY_CLASSES_ROOT\Directory\shell\delas\command]
@="nircmd.exe exec hide cmd.exe /c del /f/s/q \"%1\" > nul & rmdir /s/q \"%1\" "
"IsolatedCommand"="nircmd.exe exec hide cmd.exe /c del /f/s/q \"%1\" > nul & rmdir /s/q \"%1\" "

To uninstall:

Windows Registry Editor Version 5.00


[-HKEY_CLASSES_ROOT\*\shell\delas]

[-HKEY_CLASSES_ROOT\Directory\shell\delas]

But I still need help with #2 and #3.

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.