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.

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

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 1
    dupe: superuser.com/questions/42537/… – fretje Mar 29 '10 at 13:47
  • This isn't a dupe. The OP is asking for how to spawn a process as an admin. The Win32 term is "elevate". Runas simply spawns a process as a different user. Just like Linux, not all processes have "admin" permissions even though your user credentials have admin permissions. – surfasb Jan 24 '14 at 3:58
  • Aye, I've basically solved the problem by just cutting back on my Windows use :) – Stabledog Jan 25 '14 at 7:00
runas /user:domain\administrator commandtorun

Type runas on its own to see the full syntax.

runas on TechNet

The popup is Windows' User Account Control (UAC) technology, and you can't bypass it because it increases security by requiring user confirmation. This is similar to sudo requiring a password. You can disable UAC, just as you can enable password-less sudo. It's true that UAC isn't quite as configurable as sudo however.

  • 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

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