Name

runas

Synopsis

Runs a program using alternate credentials than those currently being used. This command is new to Windows 2000.

Syntax

runas [/profile] [/env] [/netonly] /user:credentials 
                     program

Options

/user: credentials

User credentials for running the program. (The syntax is user@domain or domain\user for domain accounts and user@computer or computer\user for local accounts.)

program

Program to be run.

/profile

User’s profile (may need to be loaded for some programs).

/env

Current network environment instead of user’s local environment.

/netonly

For remote access.

Examples

To open a command shell using the default Administrator account for the domain while logged on as an ordinary domain user:

                     runas /user:administrator@mtitworld.com cmd 
Enter password for administrator@mtitworld.com: ********
Attempting to start "cmd" as user 
   "administrator@mtitworld.com"...

A second command shell now opens with the following in the title bar:

cmd (running as administrator@mtitworld.com)

To run Computer Management using the administrator account JaneD from the domain mtitworld.com:

                     runas /user:janed@mtitworld.com "mmc 
                        %windir%\system32\compmgmt.msc"

To open a command shell to administer a server in a different forest using credentials in that forest:

                     runas /netonly /user:
                     credentials
                      cmd

Tip

runas can also be invoked from the GUI. For example, to open the Display utility in the Control Panel using alternate credentials, select:

Start Settings Control Panel hold down Shift right-click ...

Get Windows 2000 Administration in a Nutshell now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.