Possible Duplicate:
is there any ‘Sudo’ command for windows ?

I want to run a console program in Windows, but it required administrative privileges. So, I can right click the command prompt to run as administrator, but I want to use something from the command line to elevate the program.

Is there something like sudo in Windows?

link|improve this question
1  
@Blorgbeard: My answer isn't in that other question, so not exactly a dup. – harrymc May 19 '10 at 9:14
feedback

closed as exact duplicate by Mehper C. Palavuzlar, random May 19 '10 at 11:53

This question covers exactly the same ground as earlier questions on this topic; its answers may be merged with another identical question. See the FAQ for guidance on how to improve it.

2 Answers

Or use runas, supplied with Windows:

Runas /user:administrator notepad

Or you can have a batch file (say myrunas.bat) that contains:

Runas /user:administrator %*

%* means "all parameters".
Used, for example, as:

myrunas notepad
link|improve this answer
feedback

Win7 and vista have an internal command called runas that'll do what you want

link|improve this answer
runas exists since Windows 2000 ... – Joey May 19 '10 at 8:14
feedback