Run PowerShell scripts as Administrator from Explorer context menu

Sometimes Windows is lacking options in the context menu, i. e. executing PowerShell scripts with administrative privileges.
The explorer context menu doesn't provide an option for start the PowerShell with administrative privileges, it provide only the option to execute PowerShell scripts.
2wt8je.png

The Widnows Regristy - broken as it is - provides the tools to enable this.
For with this run with Win+R "regedit" and navigate to the path: HKCR:\Microsoft.PowerShellScript.1\Shell\.

qixf1o.png

Add new Folder/Key with text which needs to be displayed as value. (i.g. "Run as Administrator").
Under this create a Folder/Key called "Command" and place a default key and but this value to it:
"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" "-Command" ""& {Start-Process PowerShell.exe -ArgumentList '-ExecutionPolicy RemoteSigned -File "%1"' -Verb RunAs}"

Final Result

fxpwq6.png

Or just use the PowerShell for that - but make sure that the PowerShell in run with administrative privileges. The script can find here

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now