Microsoft DOS runas command

Quick links

About runas
Availability
Syntax
Examples

About runas

Enables a user to execute a program on another computer as yourself or as another user.

Availability

The runas.exe command is an external command that is available in the below Microsoft operating systems.

Windows 2000
Windows XP
Windows Vista
Windows 7
Windows 8

Syntax

Windows Vista and later syntax
Windows XP and earlier syntax

Windows Vista and later syntax

RUNAS [ [/noprofile | /profile] [/env] [/savecred | /netonly] ] /user:<UserName> program

RUNAS [ [/noprofile | /profile] [/env] [/savecred] ] /smartcard [/user:<UserName>] program

RUNAS /trustlevel:<TrustLevel> program

/noprofile Specifies that the user's profile should not be loaded. This causes the application to load more quickly, but can cause some applications to malfunction.
/profile Specifies that the user's profile should be loaded. This is the default
/env To use current environment instead of user's.
/netonly Use if the credentials specified are for remote access only.
/savecred To use credentials previously saved by the user.
/smartcard Use if the credentials are to be supplied from a smartcard.
/user <UserName> should be in form USER@DOMAIN or DOMAIN\USER
/showtrustlevels Displays the trust levels that can be used as arguments to /trustlevel.
/trustlevel <Level> should be one of levels enumerated in /showtrustlevels.
program command line for EXE. See below for examples.

Examples:
> runas /noprofile /user:mymachine\administrator cmd
> runas /profile /env /user:mydomain\admin "mmc %windir%\system32\dsa.msc"
> runas /env /user:user@domain.microsoft.com "notepad \"my file.txt\""

NOTE: Enter user's password only when prompted.
NOTE: /profile is not compatible with /netonly.
NOTE: /savecred is not compatible with /smartcard.

Windows XP and earlier syntax

RUNAS [/profile] [/env] [/netonly] /user:<UserName> program

/profile if the user's profile needs to be loaded
/env to use current environment instead of user's.
/netonly use if the credentials specified are for remote access only.
/user <UserName> should be in form USER@DOMAIN or DOMAIN\USER
program command line for EXE. See below for examples

Examples:
> runas /profile /user:mymachine\administrator cmd
> runas /profile /env /user:mydomain\admin "mmc %windir%\system32\dsa.msc"
> runas /env /user:user@domain.microsoft.com "notepad \"my file.txt\""

NOTE: Enter user's password only when prompted.
NOTE: USER@DOMAIN is not compatible with /netonly.

Examples

See Microsoft's above examples for examples of this command.