In computing, <code>runas</code> (a compound word, from âÂÂrun asâÂÂ) is a command in the Microsoft Windows line of operating systems that allows a user to run specific tools and programs under a different username to the one that was used to logon to a computer interactively. It is similar to the Unix commands <code>sudo</code> and <code>su</code>, but the Unix commands generally require prior configuration by the system administrator to work for a particular user and/or command.
The <code>runas</code> command was introduced with the Windows 2000 operating system. Any application can use this API to create a process with alternate credentials, for example, Windows Explorer in Windows 7 allows an application to be started under a different account if the shift key is held while right clicking its icon. The program has the ability to cache verified credentials so that the user only ever has to enter them once.
The command-syntax is:
This section is paraphrased from the <code>runas /?</code> command.
Note: Only type in the user's password, when the system asks for it.
Note: The <code>/profile</code> switch is not compatible with the <code>/netonly</code> switch.
Note: The <code>/savecred</code> and the <code>/smartcard</code> switches may not be used together.
The command is also included in the Inferno operating system.
<code>runas</code> writes the <code>user</code> to <code>/dev/user</code> and invokes <code>cmd</code> with the given arguments.
Note: The command is only invoked if setting of the username succeeds.