3

I'm looking to do what's asked in this question: how to run a powershell script as administrator

The accepted answer says to use a shortcut. I'd like to do that, but when I get into Advanced Properties, everything is grayed out. How do I get around this?

2
  • Can you please provide more information? Are you logged in with an unpriviledged account? Is the shortcut located on your desktop? Mar 16, 2012 at 21:31
  • duplicate: superuser.com/a/1366964/235752
    – JinSnow
    Oct 15, 2018 at 14:50

1 Answer 1

11

The trick is to edit the Shortcut target to add powershell.exe in front of the script path so it looks something like this:

powershell.exe -file "H:\Powershell\MyPoshScript.ps1"

Click OK, then go back into Properties and the "Run as Administrator" box will now be changeable.

(note: when I did this, Windows fixed the powershell.exe reference to the full path.

3
  • This worked great! Mar 19, 2012 at 17:03
  • This is not working for me. I changed from .bat to .ps1 and still under the compatibility tab, run as administrator is grayed out.
    – Eric
    May 18, 2017 at 12:59
  • 4
    Instead of using the compatibility tab (where the option is greyed out ) use the Advanced button on the Shortcut Tab
    – Ross
    Jun 22, 2017 at 0:33

Not the answer you're looking for? Browse other questions tagged .