World Library  
Flag as Inappropriate
Email this Article


In computing, runas is a command in the Microsoft Windows line of operating systems that allows a user to run specific tools and programs under a different username to the one that was used to logon to a computer interactively. It is similar to the Unix commands sudo and su, but the Unix commands generally require prior configuration by a the system administrator to work for a particular user and/or command.


  • Microsoft Windows 1
    • Syntax 1.1
      • Explanation of the parameters 1.1.1
    • Examples 1.2
  • Inferno 2
    • Syntax 2.1
  • See also 3
  • References 4
  • External links 5

Microsoft Windows

The runas command was introduced with the Windows 2000 operating system. Any application can use this API to create a process with alternate credentials, for example, Windows Explorer in Windows 7 allows an application to be started under a different account if the shift key is held while right-clicking its icon. The program has the ability to cache verified credentials so that the user only ever has to enter them once.


runas  [/env] [/netonly] [/smartcard] [/showtrustlevels] [/trustlevel:] [/savecred] /user: program

Explanation of the parameters

This section is paraphrased from the runas /? command.

  • /noprofile: Speeds up the loading of the application by skipping the loading of the user's profile. Note that this might not speed up every application.
  • /profile: Do not skip loading the user's profile. This is the default setting.
  • /env: Use the actual environment, not the user's.
  • /netonly: Specifies that the given credentials are to be used for Remote access only.
  • /savecred: Credentials saved by the previous user. This setting is not available on Windows 7 Home or Windows 7 Starter Edition. This setting is left out from Windows XP Home Edition as well.
  • /smartcard: Specifies that the credentials will be supplied from a smartcard.
  • /user: Format is either USER@DOMAIN or DOMAIN\USER.
  • /showtrustlevels: Shows help (list of usable trust level parameters) for the /trustlevel switch.
  • /trustlevel: One of the trust levels listed by the /showtrustlevels switch.
  • program: Command line for the executable file. See examples below.

Note: Only type in the user's password, when the system asks for it.

Note: The /profile switch is not compatible with the /netonly switch.

Note: The /savecred and the /smartcard switches may not be used together.


runas /noprofile /user:machine\administrator cmd
runas /profile /env /user:domain\admin "mmc %windir%\system32\dsa.msc"
runas / "notepad C:\filename.txt"
runas /user:administrator /savecred "shutdown /i"


The command is also included in the Inferno operating system.


runas writes the user to /dev/user and invokes cmd with the given arguments.

runas user cmd [arg...]

Note: The command is only invoked if setting of the user name succeeds.

See also


External links

  • Microsoft TechNet Runas article
  • Sysinternals ShellRunas
This article was sourced from Creative Commons Attribution-ShareAlike License; additional terms may apply. World Heritage Encyclopedia content is assembled from numerous content providers, Open Access Publishing, and in compliance with The Fair Access to Science and Technology Research Act (FASTR), Wikimedia Foundation, Inc., Public Library of Science, The Encyclopedia of Life, Open Book Publishers (OBP), PubMed, U.S. National Library of Medicine, National Center for Biotechnology Information, U.S. National Library of Medicine, National Institutes of Health (NIH), U.S. Department of Health & Human Services, and, which sources content from all federal, state, local, tribal, and territorial government publication portals (.gov, .mil, .edu). Funding for and content contributors is made possible from the U.S. Congress, E-Government Act of 2002.
Crowd sourced content that is contributed to World Heritage Encyclopedia is peer reviewed and edited by our editorial staff to ensure quality scholarly research articles.
By using this site, you agree to the Terms of Use and Privacy Policy. World Heritage Encyclopedia™ is a registered trademark of the World Public Library Association, a non-profit organization.

Copyright © World Library Foundation. All rights reserved. eBooks from Project Gutenberg are sponsored by the World Library Foundation,
a 501c(4) Member's Support Non-Profit Organization, and is NOT affiliated with any governmental agency or department.