Friday, February 13, 2009

Run programs as another user in Windows 2000 / Windows XP

Windows 2000 / Windows XP comes with a commandline utility, runas.exe , which allows one to run a program using the access rights of that user. What is required is the User name, Password, and Domain. For example, if I am logged onto Windows 2000 / Windows XP Professional with a normal user account and need to edit the registry, I can do so without having to logoff and back on with my admin account.

runas /user:waynesdomain\myadminaccount regedt32.exe

Runas can be used to start any program, MMC console, or Control Panel item as long as the following requirements are met:

  • You provide the appropriate user account and password information.
  • The user account has the ability to log on to the computer.
  • The program, MMC console, or Control Panel item is available on the system and to the user account.
source:
http://www.windowsnetworking.com/nt/nt2000/atips/atips12.shtml


UPDATE

At a CMD prompt I enter:
runas /env /user:Administrator explorer.exe
I get the prompt to enter the password for Administrator and enter it (I set the PC up so I'm definite that I'm entering the correct password)
I see 'Attempting to start explorer.exe as User "A12345\Administrator".. but nothing happens, I'm just returned to the prompt.

Solution

I always use the following command to launch a separate explorer shell on XP/IE7. Looks like /separate switch is undocumented. Haven't seen it much on web.

Run this command: runas /u:administrator "explorer.exe /separate"

Enter the password and you should see the separate explorer shell running under the administrator account.

source:
http://www.google.com/url?sa=U&start=2&q=http://stackoverflow.com/questions/13805/opening-explorer-shell-with-admin-priveleges-on-xp-with-ie7-installed&ei=OgCWSZ-JIsmH-gbY-aSPCQ&usg=AFQjCNFHpCNAOhBZqOvH_HsdVAcLrzK8IA

No comments:

Post a Comment