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.

  • Availability

  • Runas syntax

  • Runas examples

  • Windows 2000

  • Windows XP

  • Windows Vista

  • Windows 7

  • Windows 8

  • Windows 10

  • Windows 11

Runas syntax

Windows Vista and later syntax

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

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

RUNAS /trustlevel: program

Examples

runas /noprofile /user:mymachine\administrator cmd runas /profile /env /user:mydomain\admin “mmc %windir%\system32\dsa.msc” runas /env /user:[email protected] “notepad "my file.txt"”

Windows XP and earlier syntax

RUNAS [/profile] [/env] [/netonly] /user: program

runas /profile /user:mymachine\administrator cmd runas /profile /env /user:mydomain\admin “mmc %windir%\system32\dsa.msc” runas /env /user:[email protected] “notepad "my file.txt"”

Runas examples

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

  • Windows Vista and later syntax.
  • Windows XP and earlier syntax.

Enter a user’s password only when prompted.

The switch /profile is not compatible with /netonly.

The switch /savecred is not compatible with /smartcard.

Enter user’s password only when prompted.

[email protected] is not compatible with /netonly.