Skip to content

Instantly share code, notes, and snippets.

@JoshuaTheMiller
Created February 22, 2018 02:58
Show Gist options
  • Save JoshuaTheMiller/6accf2a9cf1d7d3dc714ec77ef949aef to your computer and use it in GitHub Desktop.
Save JoshuaTheMiller/6accf2a9cf1d7d3dc714ec77ef949aef to your computer and use it in GitHub Desktop.
Adds the ability to open the current folder in an Administrative Command Prompt via the Windows 10 context menu. Use at your own risk as this modifies the registry.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\OpenElevatedCmd]
@="Open with Administrator Command Prompt"
"Icon"="cmd.exe"
[HKEY_CLASSES_ROOT\Directory\shell\OpenElevatedCmd\command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs\""
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenElevatedCmd]
@="Open with Administrator Command Prompt"
"Icon"="cmd.exe"
[HKEY_CLASSES_ROOT\Directory\Background\shell\OpenElevatedCmd\command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs\""
[HKEY_CLASSES_ROOT\Drive\shell\OpenElevatedCmd]
@="Open with Administrator Command Prompt"
"Icon"="cmd.exe"
[HKEY_CLASSES_ROOT\Drive\shell\OpenElevatedCmd\command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs\""
[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenElevatedCmd]
@="Open with Administrator Command Prompt"
"Icon"="cmd.exe"
[HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenElevatedCmd\command]
@="PowerShell -windowstyle hidden -Command \"Start-Process cmd.exe -ArgumentList '/s,/k,pushd,%V' -Verb RunAs\""
[-HKEY_CLASSES_ROOT\Directory\shell\OpenElevatedCmd]
[-HKEY_CLASSES_ROOT\Directory\shell\OpenElevatedCmd\command]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\OpenElevatedCmd]
[-HKEY_CLASSES_ROOT\Directory\Background\shell\OpenElevatedCmd\command]
[-HKEY_CLASSES_ROOT\Drive\shell\OpenElevatedCmd]
[-HKEY_CLASSES_ROOT\Drive\shell\OpenElevatedCmd\command]
[-HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenElevatedCmd]
[-HKEY_CLASSES_ROOT\LibraryFolder\background\shell\OpenElevatedCmd\command]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment