0

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.

0

1 Answer 1

0

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.

1
  • 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. Jun 9, 2012 at 2:48

Not the answer you're looking for? Browse other questions tagged .