ARCHIVED: In Windows, how do I run an application as an alternate user?
Windows 7, Vista, and XP offer a Secondary Logon service (also known as "run as") that lets you run programs as different users. This tool is helpful in applying the principle of least privilege. For example, you can log into your computer as a normal user, and when you need to have administrative privileges to carry out a task, you can launch that program using the Secondary Logon service to select an administrative account.
You can use the Secondary Logon service in a couple of ways:
Run as...
In Windows 7 and Vista, by default, the
option is not available. However, if you right-click an application, you can choose the option, which is typically followed by a User Account Control (UAC) prompt asking you to continue.You can also download an external shell add-on that adds the ShellRunas.
feature to Vista; seeIn Windows XP, navigate to the program you'd like to launch with
different privileges. Click it once to select it, and then hold down
the Shift
key and right-click the program. You'll see a
contextual menu from which you can select , and then choose a different account.
Run
In Windows 7 and Vista, from the run
in the "Start Search" field. When the
icon appears, click it. In XP, from the menu, select
.
Enter the following command:
runas /user:username cmd
Replace username
with the name of the account you want to
use. You can replace cmd
with any command you'd like to
run (if it contains spaces between characters, enclose it in double
quotes). Click . When prompted, enter the password for the
account you've chosen. This method will start a new command shell in a
new session, from which you can launch programs.
For more information about the Windows Secondary Logon service, see articles 225035 and 305780 at the Microsoft Help and Support web site.
This is document amsq in the Knowledge Base.
Last modified on 2018-01-18 13:43:35.