Home > Commands N-Z > Commands R

RUNAS


Description | Syntax | Parameters | Switches | Related | Notes | Examples | Errorlevels | Availability

Execute a program under a different user account.


Syntax

RUNAS /?

RUNAS [{/profile |/noprofile}] [/env] [/netonly] [/smartcard] [/showtrustlevels] [/trustlevel] /user:username program


Parameters
program (NT2000)
The command to execute.

Switches
/? (NTXP)
Displays help.
/env (NT2000)
Use current environment instead of user's.
/netonly (NT4)
Use if the credentials specified are for RAS only.
/noprofile (NTXP)
Specifies that the user's profile is not to be loaded. This allows the application to load more quickly, but it can also cause a malfunction in some applications.
/profile (NT4)
Load the user's profile (registry). Default.
/showtrustlevels (NTXP)
Lists the /trustlevel options.
/smartcard (NTXP)
Indicates whether the credentials are to be supplied from a smartcard.
/trustlevel (NTXP)
Specifies the level of authorization at which the application is to run. Use /showtrustlevels to see the trust levels available.
/user:username (NT4)
Username in form USER@DOMAIN or DOMAIN\USER (USER@DOMAIN is not compatible with /netonly).

Related

AT - Run a command on a remote machine (at a scheduled time).
Equivalent Linux BASH commands:
SU - Switch User.


Notes

Enter user's password only when prompted.


Examples
    RUNAS /profile /user:mymachine\administrator CMD

    RUNAS /profile /env /user:SCOT_DOMAIN\administrator NOTEPAD

    RUNAS /env /user:user@domain.microsoft.com "NOTEPAD \"my file.txt\""

Errorlevels

none.


Availability
External
DOS
none
Windows
none
Windows NT
NT4 NT2000 NTXP NT2003