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.

Ahmed Ghoneim
  • 446
  • 1
  • 7
  • 11

1 Answers1

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.

voney
  • 84
  • 3
  • 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 09 '12 at 02:48