Saturday, 6 April 2019

windows - How to run program from command line with elevated rights


Is there a way to run a program or command with elevated rights when I am already in a non-elevated command line?


Exactly the same action that would be performed when I click on the program shortcut and select Run as administrator.


The runas command is probably not a solution - it asks for a password, but I just want the UAC dialog.



Answer



It looks like this utility - Hidden Start - will do what you wish if you use the /uac switch. Here's an example command line:


hstart /UAC "notepad.exe"

This will pop up the UAC dialog rather than ask for a password like runas does.


enter image description here


No comments:

Post a Comment

How can I VLOOKUP in multiple Excel documents?

I am trying to VLOOKUP reference data with around 400 seperate Excel files. Is it possible to do this in a quick way rather than doing it m...