shell - Adding a new (hidden) "Delete" Context Menu item to Windows 7

06
2014-04
  • user293324

    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.

  • Answers
    Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

    Related Question

    php - Windows XP - 'New' Context Menu Items
  • Thomas

    I am attempting to create new items in this context menu.

    enter image description here

    Some file extensions cannot be added. I have tried both the TweakUI method and the manual registry editing method but both seem to yield nothing (no item appears in the menu) for particular file types (.php, in this case).

    Ultimately I want to be able to select a .PHP file (could be blank, or a template) from the New menu and have it spawned where the context menu is brought up. The Template section of TweakUI could do this, if it were not for the fact that .php files refuse to work.

    Any ideas why I am unable to add a .php item to the 'New' menu?


  • Related Answers
  • caliban

    I believe you must associate the .PHP extension first with a program.