Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

Commands su & sudo could be used to turn whole current terminal session as super user with administration privileges.

What's the corresponding command of Windows CMD ?

I know that I can start CMD as administrator by

  • Right click & Start as Administrator
  • Typing CMD in start search bar the CTRL + SHIFT + ENTER

But I want to evaluate this permission from inside CMD.

share|improve this question

marked as duplicate by iglvzx, shf301, Bob, slhck, Mokubai Jun 9 '12 at 11:38

This question was marked as an exact duplicate of an existing question.

up vote 0 down vote accepted

The equivalent in Windows is the "runas" command, it is similar to the "sudo" command in unix/linux but you have to specify the user as well. A typical example would be:

runas /user:mymachine\administrator [command]

If your user is is an Administrator you can use your own username like so:

runas /user:myusername ipconfig

To elevate an entire command prompt just put "cmd" in as the command to run, ie:

runas /user:myusername cmd

There may be other ways of doing this, but this is the way I've done it for years and have seen done in corporate scripted environments.

share|improve this answer
runas is more like su than sudo. Sudo will attempt to run your command as super user. su is akin to switch user. With runas you can execute commands as a lower privilege user if desired. – Some Random Kid Jun 9 '12 at 2:48

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