Thursday, June 1, 2017

How to run associated file as administrator in windows 10

1. create shortcut to the application you want to run and check run as admin checkbox in advanced settings.
2. edit file association to refer to the cmd and run the shortcut just created with %1 parameter, example:
cmd /c "C:\WINDOWS\system32\WindowsPowerShell\v1.0\ps.lnk %1"

As you can see I did this for the powershell file, to open ISE as admin when I click edit from the file menu.

Very simple... do you know better way??