how to use command prompt instead of powershell when i press shift right click

Discussion in 'Windows 10' started by fardeen, Mar 31, 2017.

  1. hb860

    hb860 MDL Expert

    May 7, 2010
    1,011
    1,838
    60
    #21 hb860, Apr 2, 2017
    Last edited: Apr 2, 2017
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. l33tissw00t

    l33tissw00t MDL Addicted

    Dec 6, 2012
    814
    515
    30
    That's what I did on my current setup (W7).
     
  3. dhjohns

    dhjohns MDL Guru

    Sep 5, 2013
    3,275
    1,734
    120
    I don't see what the deal is. Why would you want to use the command prompt anyway? If you open power shell, and type cmd, then press return, you will get the command prompts. Simple as that. Power Shell is a very powerful tool, and I use it extensively.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. kaljukass

    kaljukass MDL Guru

    Nov 26, 2012
    2,293
    807
    90
    :g: It is because people like to create a pseudo-problems. You see it.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    11,218
    48,250
    340
    #25 abbodi1406, Apr 2, 2017
    Last edited by a moderator: Apr 20, 2017
  6. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,130
    24,231
    340
    @ abbodi

    Can you provide MUIVerb value for powershell?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    11,218
    48,250
    340
    #27 abbodi1406, Apr 2, 2017
    Last edited by a moderator: Apr 20, 2017
    Code:
    Windows PowerShell
    @powershell.exe,-109
    
    Open Windows PowerShell
    @shell32.dll,-37446
    
    Open Windows PowerShell as administrator
    @shell32.dll,-37448
     
  8. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,130
    24,231
    340
    #28 s1ave77, Apr 2, 2017
    Last edited by a moderator: Apr 20, 2017
    Slightly updated version (fusion with previous and some abbodi):

    Code:
    ::COMMAND PROMPT HERE
        reg add "HKCR\Directory\shell\MenuCmd" /v "MUIVerb" /t REG_SZ /d "@shell32.dll,-22022" /f
        reg add "HKCR\Directory\shell\MenuCmd" /v "Icon" /t REG_SZ /d "cmd.exe" /f
        reg add "HKCR\Directory\shell\MenuCmd" /v "ExtendedSubCommandsKey" /t REG_SZ /d "Directory\ContextMenus\MenuCmd" /f
        reg add "HKCR\Directory\shell\MenuCmd" /v "Position" /t REG_SZ /d "bottom" /f
        reg add "HKCR\Directory\background\shell\MenuCmd" /v "MUIVerb" /t REG_SZ /d "@shell32.dll,-22022" /f
        reg add "HKCR\Directory\background\shell\MenuCmd" /v "Icon" /t REG_SZ /d "cmd.exe" /f
        reg add "HKCR\Directory\background\shell\MenuCmd" /v "ExtendedSubCommandsKey" /t REG_SZ /d "Directory\ContextMenus\MenuCmd" /f
        reg add "HKCR\Directory\background\shell\MenuCmd" /v "Position" /t REG_SZ /d "bottom" /f
        reg add "HKCR\LibraryFolder\background\shell\MenuCmd" /v "MUIVerb" /t REG_SZ /d "@shell32.dll,-22022" /f
        reg add "HKCR\LibraryFolder\background\shell\MenuCmd" /v "Icon" /t REG_SZ /d "cmd.exe" /f
        reg add "HKCR\LibraryFolder\background\shell\MenuCmd" /v "ExtendedSubCommandsKey" /t REG_SZ /d "Directory\ContextMenus\MenuCmd" /f
        reg add "HKCR\LibraryFolder\background\shell\MenuCmd" /v "Position" /t REG_SZ /d "bottom" /f
        reg add "HKCR\Drive\shell\MenuCmd" /v "MUIVerb" /t REG_SZ /d "@shell32.dll,-22022" /f
        reg add "HKCR\Drive\shell\MenuCmd" /v "Icon" /t REG_SZ /d "cmd.exe" /f
        reg add "HKCR\Drive\shell\MenuCmd" /v "ExtendedSubCommandsKey" /t REG_SZ /d "Directory\ContextMenus\MenuCmd" /f
        reg add "HKCR\Drive\shell\MenuCmd" /v "Position" /t REG_SZ /d "bottom" /f
        reg add "HKCR\Directory\ContextMenus\MenuCmd\shell\open" /v "MUIVerb" /t REG_SZ /d "@shell32.dll,-37415" /f
        reg add "HKCR\Directory\ContextMenus\MenuCmd\shell\open" /v "Icon" /t REG_SZ /d "cmd.exe" /f
        reg add "HKCR\Directory\ContextMenus\MenuCmd\shell\open\command" /ve /t REG_SZ /d "cmd.exe /s /k pushd \"%%V\"" /f
        reg add "HKCR\Directory\ContextMenus\MenuCmd\shell\runas" /v "MUIVerb" /t REG_SZ /d "@shell32.dll,-37444" /f
        reg add "HKCR\Directory\ContextMenus\MenuCmd\shell\runas" /v "Icon" /t REG_SZ /d "cmd.exe" /f
        reg add "HKCR\Directory\ContextMenus\MenuCmd\shell\runas" /v "HasLUAShield" /t REG_SZ /d "" /f
        reg add "HKCR\Directory\ContextMenus\MenuCmd\shell\runas\command" /ve /t REG_SZ /d "cmd.exe /s /k pushd \"%%V\"" /f
    ::POWERSHELL PROMPT HERE
        reg add "HKCR\Directory\shell\MenuPowerShell" /v "MUIVerb" /t REG_SZ /d "@powershell.exe,-109" /f
        reg add "HKCR\Directory\shell\MenuPowerShell" /v "Icon" /t REG_SZ /d "powershell.exe" /f
        reg add "HKCR\Directory\shell\MenuPowerShell" /v "ExtendedSubCommandsKey" /t REG_SZ /d "Directory\ContextMenus\MenuPowerShell" /f
        reg add "HKCR\Directory\shell\MenuPowerShell" /v "Position" /t REG_SZ /d "bottom" /f
        reg add "HKCR\Directory\background\shell\MenuPowerShell" /v "MUIVerb" /t REG_SZ /d "@powershell.exe,-109" /f
        reg add "HKCR\Directory\background\shell\MenuPowerShell" /v "Icon" /t REG_SZ /d "powershell.exe" /f
        reg add "HKCR\Directory\background\shell\MenuPowerShell" /v "ExtendedSubCommandsKey" /t REG_SZ /d "Directory\ContextMenus\MenuPowerShell" /f
        reg add "HKCR\Directory\background\shell\MenuPowerShell" /v "Position" /t REG_SZ /d "bottom" /f
        reg add "HKCR\LibraryFolder\background\shell\MenuPowerShell" /v "MUIVerb" /t REG_SZ /d "@powershell.exe,-109" /f
        reg add "HKCR\LibraryFolder\background\shell\MenuPowerShell" /v "Icon" /t REG_SZ /d "powershell.exe" /f
        reg add "HKCR\LibraryFolder\background\shell\MenuPowerShell" /v "ExtendedSubCommandsKey" /t REG_SZ /d "Directory\ContextMenus\MenuPowerShell" /f
        reg add "HKCR\LibraryFolder\background\shell\MenuPowerShell" /v "Position" /t REG_SZ /d "bottom" /f
        reg add "HKCR\Drive\shell\MenuPowerShell" /v "MUIVerb" /t REG_SZ /d "@powershell.exe,-109" /f
        reg add "HKCR\Drive\shell\MenuPowerShell" /v "Icon" /t REG_SZ /d "powershell.exe" /f
        reg add "HKCR\Drive\shell\MenuPowerShell" /v "ExtendedSubCommandsKey" /t REG_SZ /d "Directory\ContextMenus\MenuPowerShell" /f
        reg add "HKCR\Drive\shell\MenuPowerShell" /v "Position" /t REG_SZ /d "bottom" /f
        reg add "HKCR\Directory\ContextMenus\MenuPowerShell\shell\open" /v "MUIVerb" /t REG_SZ /d "@shell32.dll,-37446" /f
        reg add "HKCR\Directory\ContextMenus\MenuPowerShell\shell\open" /v "Icon" /t REG_SZ /d "powershell.exe" /f
        reg add "HKCR\Directory\ContextMenus\MenuPowerShell\shell\open\command" /ve /t REG_SZ /d "powershell.exe -noexit -command Set-Location '%%V'" /f
        reg add "HKCR\Directory\ContextMenus\MenuPowerShell\shell\runas" /v "MUIVerb" /t REG_SZ /d "@shell32.dll,-37448" /f
        reg add "HKCR\Directory\ContextMenus\MenuPowerShell\shell\runas" /v "Icon" /t REG_SZ /d "powershell.exe" /f
        reg add "HKCR\Directory\ContextMenus\MenuPowerShell\shell\runas" /v "HasLUAShield" /t REG_SZ /d "" /f
        reg add "HKCR\Directory\ContextMenus\MenuPowerShell\shell\runas\command" /ve /t REG_SZ /d "powershell.exe -noexit -command Set-Location '%%V'" /f
    
    Look:

    Context.15063.both.jpg
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. °ツ

    °ツ MDL Addicted

    Jun 8, 2014
    763
    1,041
    30
    #29 °ツ, Apr 3, 2017
    Last edited by a moderator: Apr 20, 2017
  10. abbodi1406

    abbodi1406 MDL KB0000001

    Feb 19, 2011
    11,218
    48,250
    340
    Using Powershell to launch elevated cmd doesn't seem very practical

    the one from @AndrewRichards lanuches elevated cmd directly, with the help of runas verb
    more sophisticated :D

    for me, since PS already exist in Explorer upper menu, i don't need it on right-click menu :)
     
  11. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,130
    24,231
    340
    ^^I don't use Explorer so i like to have them both.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  12. °ツ

    °ツ MDL Addicted

    Jun 8, 2014
    763
    1,041
    30
    #32 °ツ, Apr 3, 2017
    Last edited by a moderator: Apr 20, 2017
    Yeah, can add CMD to RunAs and it won't launch it from Powershell but elevated Powershell must be launched from PowerShell then since both can't be added to RunAs. And if there is already something in RunAs like "Take Ownership" then it will get replaced by CMD when adding the tweak.

    Code:
    Windows Registry Editor Version 5.00
    
    ; Command Prompt
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\runas]
    @="Elevated Command Prompt"
    "Icon"="cmd.exe"
    "HasLUAShield"=""
    "SeparatorAfter"=""
    "Position"="Bottom"
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\runas\command]
    @="cmd.exe /S /K pushd \"%V\""
    
    [HKEY_CLASSES_ROOT\Directory\shell\runas]
    @="Elevated Command Prompt"
    "Icon"="cmd.exe"
    "HasLUAShield"=""
    "SeparatorAfter"=""
    "Position"="Bottom"
    
    [HKEY_CLASSES_ROOT\Directory\shell\runas\command]
    @="cmd.exe /S /K pushd \"%V\""
    
    ; PowerShell
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\ElevatedPowerShell]
    @="Elevated PowerShell"
    "Icon"="powershell.exe"
    "HasLUAShield"=""
    "SeparatorBefore"=""
    "Position"="Bottom"
    
    [HKEY_CLASSES_ROOT\Directory\Background\shell\ElevatedPowerShell\command]
    @="Powershell Start-Process PowerShell -verb runas -ArgumentList '-noexit', 'Push-Location -literalPath ''\"%V\"'''"
    
    [HKEY_CLASSES_ROOT\Directory\shell\ElevatedPowerShell]
    @="Elevated PowerShell"
    "Icon"="powershell.exe"
    "HasLUAShield"=""
    "SeparatorBefore"=""
    "Position"="Bottom"
    
    [HKEY_CLASSES_ROOT\Directory\shell\ElevatedPowerShell\command]
    @="Powershell Start-Process PowerShell -verb runas -ArgumentList '-noexit', 'Push-Location -literalPath ''\"%V\"'''"
     
  13. lobo11

    lobo11 TOMAHAWK CHOP

    Feb 16, 2012
    6,585
    5,333
    210
    The above reg tweak works very well. It puts a Admin PowerShell and Admin Command Prompt in your right hand click :D
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  14. Mr.X

    Mr.X MDL Guru

    Jul 14, 2013
    7,030
    14,648
    240
    Wish they could post screenshots about these reg tweaks do.
     
  15. s1ave77

    s1ave77 Has left at his own request

    Aug 15, 2012
    16,130
    24,231
    340
    #35 s1ave77, Apr 3, 2017
    Last edited: Apr 3, 2017
    Mine, using abbodis additions....

    Context.15063.both.jpg

    EDIT: Using the MUIVerb values the text shown will be localized, depending on system language.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  16. lobo11

    lobo11 TOMAHAWK CHOP

    Feb 16, 2012
    6,585
    5,333
    210
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  17. hb860

    hb860 MDL Expert

    May 7, 2010
    1,011
    1,838
    60
    #38 hb860, Apr 12, 2017
    Last edited by a moderator: Apr 20, 2017
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...