Windows command runas command

Share on facebook
Share on google
Share on twitter
Share on linkedin

Using the "Runas" command - www.lalonunez.com - YouTube

The runas command enables a user to execute a program on another computer as yourself or as another user.

Availability

Runas is an external command that is available for the following Microsoft operating systems as runas.exe.

Runas 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, which allows the application to load more quickly, but can cause some applications to malfunction.
/profile The default setting that specifies that the user’s profile should be loaded.
/env Use the current environment instead of the user’s.
/netonly Use if the credentials specified are for remote access only.
/savecred 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 the 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\""
NoteEnter a user’s password only when prompted.

NoteThe switch /profile is not compatible with /netonly.

NoteThe switch /savecred is not compatible with /smartcard.

Windows XP and earlier syntax

RUNAS [/profile] [/env] [/netonly] /user:<UserName> program
/profile Use if the user’s profile needs to be loaded.
/env Use the 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\""
NoteEnter user’s password only when prompted.

NoteUSER@DOMAIN is not compatible with /netonly.

Runas examples

See Microsoft’s above examples for examples of this command.  https://computerthang.com/p/dell-latitude-7410-14-in-notebook-a300/