Master Lamps avatar

Run PowerShell scripts as Administrator from Explorer context menu

master-lamps

Published: 05 Apr 2020 › Updated: 05 Apr 2020Run PowerShell scripts as Administrator from Explorer context menu

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

Leave Run PowerShell scripts as Administrator from Explorer context menu to:

Written by

Rabbit of Courage Difficile est satiram non scribere born with a 💚 Curator Studiorum Amatoriorum

Read more #windows posts


Best Posts From Master Lamps

We have not curated any of master-lamps's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.

More Posts From Master Lamps