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

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

  1. Mr.X

    Mr.X Registered Member

    Joined:
    Aug 10, 2013
    Posts:
    4,795
    Location:
    .
    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:
    2,587
    Location:
    Toronto, Canada
    @Mister X Thank you for sharing. This is really quite handy. I could make use of this, for sure.
     
  3. Mr.X

    Mr.X Registered Member

    Joined:
    Aug 10, 2013
    Posts:
    4,795
    Location:
    .
    Your are welcome.
     
  4. Rolo42

    Rolo42 Registered Member

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

    Mr.X Registered Member

    Joined:
    Aug 10, 2013
    Posts:
    4,795
    Location:
    .
    You're welcome.
     
  6. co22

    co22 Registered Member

    Joined:
    Nov 22, 2011
    Posts:
    411
    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. Mr.X

    Mr.X Registered Member

    Joined:
    Aug 10, 2013
    Posts:
    4,795
    Location:
    .
    No problem.

    Tested on Win7/8.1 but 10. I don't have for "new folder".
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.