Created
May 3, 2016 01:50
-
-
Save dennisroche/462ca4bfef00e4b25b023247030ce0db to your computer and use it in GitHub Desktop.
Powershell, Add 'Run As Administrator' to right-click menu
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ECHO OFF | |
TITLE Enable right-click 'Run as Admin' for PowerShell | |
ECHO. | |
ECHO Enabling right-click 'Run as Admin' for PowerShell | |
ECHO. | |
:: Add value for UAC shield icon: | |
REG ADD "HKCR\Microsoft.PowerShellScript.1\Shell\runas" /v HasLUAShield /t REG_SZ /d "" /f | |
:: Add value to create context menu item: | |
REG ADD "HKCR\Microsoft.PowerShellScript.1\Shell\runas\command" /ve /t REG_EXPAND_SZ /d "\"%%SYSTEMROOT%%\System32\WindowsPowerShell\v1.0\powershell.exe\" -executionpolicy bypass -nologo -file \"%%1\"" /f | |
ECHO. | |
ECHO Done! | |
EXIT |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment