In Windows, how do I run an application as an alternate user?
Windows 2000, XP, and Vista 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.
There are a couple of ways you can use the Secondary Logon service:
Run as...
In Vista, by default, the Run as... option is not
available. However, if you right-click an application, you can choose
the Run as administrator 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
Run as... feature to Vista; see ShellRunas.
In 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 Run
as... , and then choose a different account.
Run
In Vista, from the Start menu, enter run in
the "Start Search" field. When the Run icon appears, click
it. In XP, from the Start menu, select
Run... .
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 OK. 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.
Search Microsoft Help and Support.
Last modified on February 24, 2009.







