How To Use The Runas Command In Windows (2027)
Runas starts a program under a different user account without signing out of Windows.
The basic form is runas /user:<computer>\<account> <program>, and Windows asks for that account’s password in the window.
Microsoft’s runas page is an archived reference last updated in 2016, so this guide uses only what that page documents.
Table of Contents
- Runas quick answers
- What runas does
- Why use runas instead of signing in as an administrator
- The runas syntax
- Runas switches at a glance
- Open a Command Prompt
- Run a program as a local administrator
- Run a program as a domain administrator
- Microsoft examples in one place
- Runas and the Run as administrator menu
- Use netonly for a server in another domain
- What you can run with runas
- Things runas cannot do
- If runas fails
- Common runas mistakes
- Run a program as another account step by step
- Related guides
- Official sources
- More Windows guides
Runas quick answers
| I want to | Type this |
|---|---|
| Open a Command Prompt as another local account | runas /user:<computer>\<account> cmd |
| Run a program as a domain account | runas /user:<domain>\<account> "<program>" |
| Open a console as a domain administrator | runas /user:contoso\domainadmin "mmc %windir%\system32\compmgmt.msc" |
| Use an account only for remote network access | runas /netonly /user:<domain>\<account> "<command>" |
| Skip loading the account profile | runas /noprofile /user:<account> <program> |
| See the built-in help | runas /? |
Replace the placeholders with your own computer, domain and account names.
What runas does
Microsoft describes runas as a tool that lets a user run specific tools and programs with different permissions than the current logon provides.
It is not limited to administrator accounts, although that is the most common use.
Any user with more than one account can use it to run a program, MMC console or Control Panel item with the other account’s credentials.
Why use runas instead of signing in as an administrator
Microsoft says it is good practice to use an account with restrictive permissions for routine tasks and a broader account only for specific administrative ones.
Runas lets you do that without logging off and back on.
For the simpler case of running a window as administrator on your own account, see how to open Terminal as administrator.
The runas syntax
Microsoft gives the syntax as runas [{/profile | /noprofile}] [/env] [{/netonly | /savecred}] [/smartcard] [/showtrustlevels] [/trustlevel] /user:<UserAccountName> "<ProgramName> <PathToProgramFile>".
The only required parts are /user: with the account name and the program to run.
The account name can be written as <User>@<Domain> or <Domain>\<UserAccountName>.
Runas switches at a glance
| Switch | What it does |
|---|---|
/profile | Loads the user profile, which is the default, and cannot be combined with /netonly. |
/noprofile | Does not load the profile, so the program may start faster, but some applications can malfunction. |
/env | Uses the current network environment instead of the account local environment. |
/netonly | Says the credentials are for remote access only, and cannot be combined with /profile. |
/savecred | Uses credentials previously saved by this user, and cannot be combined with /smartcard. |
/smartcard | Takes the credentials from a smart card, and cannot be combined with /savecred. |
/showtrustlevels | Displays the trust levels you can pass to /trustlevel. |
/trustlevel | Sets the level of authorization the program runs at. |
/? | Shows help at the command prompt. |
Open a Command Prompt
- Press the Windows key and type cmd.
- Press Enter to open Command Prompt.
- Type your runas command and press Enter.
- Enter the password only when Windows prompts for it.
Microsoft’s remarks say to type the password only when prompted, so do not put it in the command.
Run a program as a local administrator
To use the Administrator account on your own computer, Microsoft gives two forms for the user switch.
/user:<AdministratorAccountName>@<ComputerName>/user:<ComputerName>\<AdministratorAccountName>
Microsoft’s example for an administrative Command Prompt is runas /user:<localmachinename>\administrator cmd.
Run a program as a domain administrator
For a domain account, the user switch takes /user:<AdministratorAccountName>@<DomainName> or /user:<DomainName>\<AdministratorAccountName>.
Microsoft’s example opens Computer Management with runas /user:contoso\domainadmin "mmc %windir%\system32\compmgmt.msc".
Its Notepad example is runas /user:[email protected] "notepad my_file.txt".
Microsoft examples in one place
| Task | Command |
|---|---|
| Administrative Command Prompt on the local computer | runas /user:<localmachinename>\administrator cmd |
| Computer Management as a domain administrator | runas /user:contoso\domainadmin "mmc %windir%\system32\compmgmt.msc" |
| Notepad with a file as another account | runas /user:[email protected] "notepad my_file.txt" |
| Tool that administers a server in another forest | runas /netonly /user:<Domain>\<User_Name> "<Command>" |
Runas and the Run as administrator menu
Microsoft’s page says the Run as command in the user interface was renamed Run as administrator starting with Windows Vista.
It adds that you should rarely need the command line, because Windows prompts for an administrator password automatically when a task needs one.
The command line is still the way to use a different account entirely, such as a separate local or domain account.
Microsoft also notes that runas can start items as an administrator while you are logged on as a member of another group, such as Users or Power Users.
| Situation | Better choice |
|---|---|
| Your own account is an administrator and you need an elevated window | Run as administrator from the Start menu |
| You need a different local account | runas /user:<computer>\<account> <program> |
| You need a domain account on a domain PC | runas /user:<domain>\<account> <program> |
| You only need remote access with other credentials | runas /netonly /user:<domain>\<account> <command> |
Use netonly for a server in another domain
Microsoft says runas lets you administer a server in another domain or forest.
The /netonly example uses runas /netonly /user:<Domain>\<User_Name> "<Command>", and that user needs enough permission to administer the server.
What you can run with runas
- Programs (.exe files).
- Saved MMC consoles (.msc files).
- Shortcuts to programs and saved MMC consoles.
- Control Panel items.
The account must be able to log on to the computer, and the item must be available on the system and to that account.
Things runas cannot do
- Items such as the Printers folder and desktop items open indirectly and cannot be started with runas.
- Starting something from a network location can fail, because the credentials used to reach the share differ from those that start the program.
- Group Policy is not processed for the account whose credentials you supply, which Microsoft says is by design.
If runas fails
Microsoft says the Secondary Logon service might not be running, or the user account might not be valid.
- Open Computer Management.
- Expand Services and Applications and select Services.
- Look for Secondary Logon and check its status.
- Test the account by trying to log on with it.
Microsoft’s Run As troubleshooting article for older Windows Server versions says some programs do not support runas, and that it does not work correctly under the LocalSystem account.
Common runas mistakes
- Writing the account without a computer or domain name.
- Forgetting the quotes around a program that has arguments.
- Combining /profile with /netonly, which Microsoft says cannot be used together.
- Combining /savecred with /smartcard.
- Expecting a program on a network share to open without extra access.
Run a program as another account step by step
- Open Command Prompt.
- Run
runas /user:<computer>\<account> "<program>"with your own names. - Type the password when Windows asks.
- Check that the program opened under the other account, then close it when done.
Related guides
To check which accounts exist first, see the net user command guide.
To make an account an administrator instead, see how to change an account to administrator.
To control the approval prompts, see how to change UAC settings.
Official sources
The syntax, switches, remarks and examples come from Microsoft’s runas reference.
The Secondary Logon and limitation notes also draw on Microsoft’s Run As feature article.
More Windows guides
- How To Use The Icacls Command In Windows (2027)
- How To Use The Setx Command In Windows (2026)
- How To Use The Takeown Command In Windows (2027)
- How To Use The Defrag Command In Windows (2027)
- How To Use The Mklink Command In Windows (2026)
- How To Use The Fsutil Command In Windows (2026)
See all: Windows 11 Guides