Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • 2
    Also, unlike sudo, runas will never cache the password for any length of time. So if you were planning on queuing up a couple quick commands like you can with successive runs of sudo. So just open a console window and run your commands there.
    – Joshua
    Commented Nov 24, 2009 at 2:26
  • so the shortest form is "runas /user:DOMAIN\Administrator cmd.exe" wow... that's pretty long and hard to remember... and i can create an alias, but what if i am on someone else's computer and helping out? will it be a good idea if MS can create a special command called runasadmin? Commented Nov 24, 2009 at 9:23
  • 5
    Joshua: Unless you use /savecred. Commented Nov 24, 2009 at 18:19
  • +1, and for local admin runas /user:administrator cmd.exe is not hard to remember after a dozen types or so. All it is is the command itself runas followed by the /user: switch, followed by the user we want to run it as, then finally the program we want to run, cmd.exe (the command prompt in our case). This is as close to a one line you can get for running command prompts elevated. Also, if you do start->run sometimes there's a checkbox to run the program elevated, I haven't put any effort into figuring out what makes it appear, but it is an option.
    – MDMoore313
    Commented Mar 9, 2013 at 5:31
  • 2
    It appears that by default the administrator does not have a password. And that the account is actually disabled. The administrator account needs to be first enabled, given a password and then it becomes an actual user that you can log into and runas into. Commented Mar 24, 2016 at 14:49