stringtranslate.com

runas

In computing, runas (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.[1] It is similar to the Unix commands sudo and su, but the Unix commands generally require prior configuration by the system administrator to work for a particular user and/or command.

Microsoft Windows

The runas command was introduced with the Windows 2000 operating system.[2] 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.

Syntax

The command-syntax is:[3]

runas [{/profile | /noprofile}] [/env] [/netonly] [/smartcard] [/showtrustlevels] [/trustlevel:<TrustLevel>] [/savecred] /user:<UserAccountName> program

Parameters

This section is paraphrased from the runas /? command.

Note: Only type in the user's password, when the system asks for it.

Note: The /profile switch is not compatible with the /netonly switch.

Note: The /savecred and the /smartcard switches may not be used together.

Examples

runas /noprofile /user:machine\administrator cmdrunas /profile /env /user:domain\admin "mmc %windir%\system32\dsa.msc"runas /user:[email protected] "notepad C:\filename.txt"runas /user:administrator /savecred "shutdown /i"

Inferno

The command is also included in the Inferno operating system.[4]

Syntax

runas writes the user to /dev/user and invokes cmd with the given arguments.

runas user cmd [arg...]

Note: The command is only invoked if setting of the username succeeds.

See also

References

  1. ^ "Runas". learn.microsoft.com. 2009-09-11. Retrieved 2024-07-04.
  2. ^ "MS-DOS and Windows command line runas command". computerhope.com. Retrieved 2024-07-04.
  3. ^ "Runas - Run under a different user account - Windows CMD - SS64.com". ss64.com. Retrieved 2024-07-04.
  4. ^ "Inferno's RUNAS(1 )".

Further reading

External links