Possible Duplicate:
is there any 'Sudo' command for windows ?

Is there a command line equivalent to sudo in Windows 7? Or do you just have to open a command prompt that is being run as administrator?

link|improve this question

79% accept rate
feedback

closed as exact duplicate by Sathya, Gilles, CarlF, nhinkle, Diago Nov 12 '10 at 7:09

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.

4 Answers

up vote 10 down vote accepted

The runas command is the equivelent of sudo in windows 7.

runas [{/profile|/noprofile}] [/env] [/netonly] [/smartcard] [/showtrustlevels] [/trustlevel] /user:UserAccountName program

Run the following command to start a command shell as an administrator. EDIT: Or you could right click the command prompt and click Run As Administrator.

runas /noprofile /user:Administrator cmd

link|improve this answer
I think it's quite common, but notice that sudo is different than su in the way that you can setup a sudo user to be able to only run a specific application as root with its own password, while su requires the user to enter the actual root password. runas is the same as su, not sudo. – Filipe Pina Apr 19 at 22:14
feedback

Runas is a pretty functional equivalent.

link|improve this answer
feedback

It's easiest to run CMD as administrator (or elevated, in the case of standalone desktop Windows), but there is the runas command as well.

link|improve this answer
feedback

The failure IMO with runas is that when used, you are "running as" a different user. Different environment, different sets of defaults ...

A BIG TIME failure for me.

SuRun - SUDO in Windows states:

The best part is - SuRun will elevate the privileges for the CURRENT user account! It will not try to run programs as another, administrator account. This means all registry entries and file system paths will be correct, just as the user expects them!

(I have not tried it - yet. Cannot believe they way MS has implemented elevation & that I may have to resort to a third party program to have things work they way they should have in the first place.)

link|improve this answer
feedback

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