Switch to a different user in MS Windows / DOS

Problem

You want to switch user from the MS DOS prompt.



Solution

Use runas

runas /?


Example


Switch user to other id (Then just run explorer and browse to directory)

runas /user:USERID@xxx c:\winnt\system32\cmd.exe

Where user-id is the USER you wish to change to. For example Admin. xxx represents the hostname of the box or domain.

You can also just use local, if changing to user on the same box, like this:

C\:Documents and Settings\Admin runas /user:localmarcus "c:\WINDOWS\system32\cmd.exe"Enter the password for localmarcus:Attempting to start c\:WINDOWS\system32\cmd.exe as user "localmarcus" ...


Reference



Leave a Reply

Your email address will not be published. Required fields are marked *