Skip to content

Instantly share code, notes, and snippets.

@BinarSkugga
Created May 23, 2019 01:14
Show Gist options
  • Save BinarSkugga/82cbc6a33969ad8f9c4cb897e3091b5d to your computer and use it in GitHub Desktop.
Save BinarSkugga/82cbc6a33969ad8f9c4cb897e3091b5d to your computer and use it in GitHub Desktop.
Context menu option to open PowerShell as admin at the location pointed.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\Powershell_admin]
@="Open PowerShell Here (Administrator)"
"Icon"="C:\\\\Windows\\\\System32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe"
[HKEY_CLASSES_ROOT\Directory\shell\Powershell_admin\command]
@="\"C:\\\\Windows\\\\System32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe\" -Command \"&{Start-Process C:\\\\Windows\\\\System32\\\\WindowsPowerShell\\\\v1.0\\\\powershell.exe -ArgumentList '-NoExit -Command &{cd \\\"%1\\\"}' -Verb RunAs}\""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment