Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|improve this question
up vote 13 down vote accepted

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

share|improve this answer
Accepting this answer for its simplicity. – Lukas Cenovsky Oct 16 '09 at 8:51

There is a way to do this in PowerShell:

PS> Start-Process powershell -Verb runAs
share|improve this answer
Seems to work fine. From command line, you could do for instance powershell -Command "Start-Process 'C:\program.exe' -Verb runAs" – marsze Oct 9 '14 at 11:08
This should be marked as the right/best answer IMO - it works without 3rd party utilities. – crimbo Oct 21 '15 at 1:07

Have a look at this question on Stack Overflow to which several other options have been answered, including a simple solution without third-party tools based on PowerShell.

share|improve this answer

Take a look at Start++ - it has this functionality along with a lot of other useful things. To run with the UAC prompt, simply use sudo then your program name at the command line as shown here:

alt text

Here are some other features (you can also add your own):

alt text

alt text

share|improve this answer
Looks also good but I already use FARR which has similar functionality as Start++ and more (of course except sudo). – Lukas Cenovsky Oct 16 '09 at 8:54
Wow seems amazing ! – asksuperuser Nov 3 '09 at 19:34
The link says Welcome to: This Web page is parked FREE. Want to buy – xmojmr Jan 5 '15 at 12:15

There is an utility named hstart which should do what you need.

share|improve this answer
this is the same as the accepted answer... – jiggunjer Jan 17 at 15:44

You must log in to answer this question.

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