Tweak to Right Click on Drives/Folders to launch an Elevated CMD and Powershell Prompt

Discussion in 'other software & services' started by Mister X, Oct 24, 2015.

  1. Mister X

    Mister X Registered Member

    Joined:
    Aug 10, 2013
    Posts:
    1,764
    Location:
    Mexico
    Here's a very handy solution for those who make use of prompts over different locations/paths very often.

    This tweak enables the right click (context menu) on a folder or drive to open a command prompt window or powershell window. Moreover, to permanently enable it without pressing the <Shift> key. Besides you can open the window with non-admin privileges or elevated privileges.

    Just save the following commands into a script/batch file (.cmd/.bat) by copying the code and pasting in a txt file and saving as Enable.cmd and Disable.cmd

    Enable:
    Code:
    reg add "HKCR\Directory\shell\cmdhere" /v "Icon" /t REG_SZ /d "imageres.dll,-5323" /f
    reg add "HKCR\Directory\shell\cmdhere" /v "MUIVerb" /t REG_SZ /d "@shell32.dll,-37415" /f
    reg add "HKCR\Directory\shell\cmdhere" /v "Position" /t REG_SZ /d "Bottom" /f
    reg add "HKCR\Directory\shell\cmdhere" /v "SubCommands" /t REG_SZ /d "Windows.MultiVerb.cmd;Windows.MultiVerb.cmdPromptAsAdministrator;|;Windows.MultiVerb.Powershell;Windows.MultiVerb.PowershellAsAdmin" /f
    reg add "HKCR\Directory\Background\shell\cmdhere" /v "Icon" /t REG_SZ /d "imageres.dll,-5323" /f
    reg add "HKCR\Directory\Background\shell\cmdhere" /v "MUIVerb" /t REG_SZ /d "@shell32.dll,-37415" /f
    reg add "HKCR\Directory\Background\shell\cmdhere" /v "Position" /t REG_SZ /d "Bottom" /f
    reg add "HKCR\Directory\Background\shell\cmdhere" /v "SubCommands" /t REG_SZ /d "Windows.MultiVerb.cmd;Windows.MultiVerb.cmdPromptAsAdministrator;|;Windows.MultiVerb.Powershell;Windows.MultiVerb.PowershellAsAdmin" /f
    reg add "HKCR\Drive\shell\cmdhere" /v "Icon" /t REG_SZ /d "imageres.dll,-5323" /f
    reg add "HKCR\Drive\shell\cmdhere" /v "MUIVerb" /t REG_SZ /d "@shell32.dll,-37415" /f
    reg add "HKCR\Drive\shell\cmdhere" /v "Position" /t REG_SZ /d "Bottom" /f
    reg add "HKCR\Drive\shell\cmdhere" /v "SubCommands" /t REG_SZ /d "Windows.MultiVerb.cmd;Windows.MultiVerb.cmdPromptAsAdministrator;|;Windows.MultiVerb.Powershell;Windows.MultiVerb.PowershellAsAdmin" /f
    Disable:
    Code:
    reg delete "HKEY_CLASSES_ROOT\Directory\shell\cmdhere" /f
    reg delete "HKEY_CLASSES_ROOT\Directory\Background\shell\cmdhere" /f
    reg delete "HKEY_CLASSES_ROOT\Drive\shell\cmdhere" /f
    DRIVES.png
    FOLDERS.png
     
  2. WildByDesign

    WildByDesign Registered Member

    Joined:
    Sep 24, 2013
    Posts:
    1,627
    Location:
    Toronto, Canada
    @Mister X Thank you for sharing. This is really quite handy. I could make use of this, for sure.
     
  3. Mister X

    Mister X Registered Member

    Joined:
    Aug 10, 2013
    Posts:
    1,764
    Location:
    Mexico
    Your are welcome.
     
  4. Rolo42

    Rolo42 Registered Member

    Joined:
    Jan 22, 2012
    Posts:
    569
    Location:
    USA
    Very nice; thanks for posting it.
     
  5. Mister X

    Mister X Registered Member

    Joined:
    Aug 10, 2013
    Posts:
    1,764
    Location:
    Mexico
    You're welcome.
     
  6. co22

    co22 Registered Member

    Joined:
    Nov 22, 2011
    Posts:
    253
    Location:
    router
    thank you Mister X ,long time ago i want such as(submenu cmd,uac cmd) thing but i can not find it anywhere until now.
    this work on windows 7?or just 8,8.1,10?
    have you registry code for adding "new folder" on right click?
     
  7. Mister X

    Mister X Registered Member

    Joined:
    Aug 10, 2013
    Posts:
    1,764
    Location:
    Mexico
    No problem.

    Tested on Win7/8.1 but 10. I don't have for "new folder".
     
Loading...