Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

5 Answers 5

up vote 11 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
3  
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

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: brandontools.com. This Web page is parked FREE. Want to buy brandontools.com? –  xmojmr Jan 5 at 12:15

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

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.