Possible Duplicate:
Is there any 'sudo' command for Windows?

I'm aware of the various options for setting the "run as administrator" flag, and for opening an admin console window. But what if I have a normal console window, and I want to run a command as an administrator? The 'runas' program doesn't seem to have an option that says "please don't show me some popup that I have to click on".

What I really want is something like sudo for Windows.

link|improve this question

1  
dupe: superuser.com/questions/42537/… – fretje Mar 29 '10 at 13:47
feedback

closed as exact duplicate by fretje, quack quixote Mar 29 '10 at 14:05

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.

1 Answer

runas /user:domain\administrator commandtorun

Type runas on its own to see the full syntax.

runas on TechNet

The popup is a security feature, so you won't be able to bypass it at this level. There's probably a setting/registry value to turn it off, but then you lose that security benefit. Sudo has a similar protection - by requiring you to enter a password.

link|improve this answer
Unfortunately, it doesn't work. There is only one account on the system (mine) which is id'ed as {first.lastname}. It is already an admin account, but those privileges aren't enabled in a standard command line. When I try to do 'runas /user:{machine}\{myname}, it just spits back usage text with no error message. There doesn't seem to be an option for "elevate my privileges". Doing "runas /user:[machine]\Administrator" produces the same response. – Stabledog Mar 29 '10 at 13:51
@Stabledog: Is the "Administrator" account enabled? Have you tried simply runas /user:Administrator (without machine or domain)? – fretje Mar 29 '10 at 14:15
feedback

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