Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rsrini7/cfc94ca229d87aa741989d05ffcc1d4a to your computer and use it in GitHub Desktop.
Save rsrini7/cfc94ca229d87aa741989d05ffcc1d4a to your computer and use it in GitHub Desktop.
Add open command window here and powershell here
Windows Registry Editor Version 5.00
; Add Open cmd and powershell here with administrator variations to right click context menu
[HKEY_CLASSES_ROOT\Directory\Background\shell\CliHere]
"MUIVerb"="Open CLI here"
"Position"="Middle"
"Icon"="cmd.exe"
"SubCommands"=""
[HKEY_CLASSES_ROOT\Directory\Background\shell\CliHere\shell\01subcmd]
"MUIVerb"="cmd"
"Extended"=-
"Icon"="cmd.exe"
[HKEY_CLASSES_ROOT\Directory\Background\shell\CliHere\shell\01subcmd\command]
@="cmd.exe /s /k pushd \"%V\""
[HKEY_CLASSES_ROOT\Directory\Background\shell\CliHere\shell\02subcmd]
"MUIVerb"="cmd (Administrator)"
"Extended"=-
"Icon"="cmd.exe"
"HasLUAShield"=""
[HKEY_CLASSES_ROOT\Directory\Background\shell\CliHere\shell\02subcmd\command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/k,pushd,%V' -Verb RunAs\""
[HKEY_CLASSES_ROOT\Directory\Background\shell\CliHere\shell\03subcmd]
"MUIVerb"="powershell"
"Extended"=-
"Icon"="powershell.exe"
[HKEY_CLASSES_ROOT\Directory\Background\shell\CliHere\shell\03subcmd\command]
@="PowerShell -noexit -nologo -command Set-Location -literalPath '%V'"
[HKEY_CLASSES_ROOT\Directory\Background\shell\CliHere\shell\04subcmd]
"MUIVerb"="powershell (Administrator)"
"Extended"=-
"Icon"="powershell.exe"
"HasLUAShield"=""
[HKEY_CLASSES_ROOT\Directory\Background\shell\CliHere\shell\04subcmd\command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd -ArgumentList '/s,/k,pushd,%V && start PowerShell -nologo && exit' -Verb RunAs\""

Windows registry files for adding cascading open command window here and powershell with administrator variations to right click context menu. Context menu hierarchy is like this:

  • Open CLI here >
    • cmd
    • cmd (Administrator)
    • powershell
    • powershell (Administrator)
Windows Registry Editor Version 5.00
; Remove Open cmd and powershell here
[-HKEY_CLASSES_ROOT\Directory\Background\shell\CliHere]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment