su for Windows XP

Ever wanted to perform an action as the administrator (super-user) in Windows / Windows XP but you didn’t want to go to the bother of switching users?

I’ve worked out a shortcut that does just that.

%windir%\System32\runas.exe /user:myMachine\adminUser "C:\Program Files\Internet Explorer\IEXPLORE.EXE c:"

Replace myMachine with your computer’s name. Put the name of the administrator account in for adminUser.

Here’s how it looks on my computer:

%windir%\System32\runas.exe /user:orion\root "C:\Program Files\Internet Explorer\IEXPLORE.EXE c:"

When you run this shortcut, you’ll be prompted to enter the password for your admin account.

It works very well for most tasks. You may notice that you have to manually refresh Explorer windows running as admin using this shortcut. For instance, if you rename a file or add a folder the change won’t appear automatically, but if you press F5, it shows up.

This works for Windows 2000 and for Windows XP. I it does not work well under Windows Vista, but then you don’t need it for Vista as the OS makes it easy to elevate your privileges when needed.

Advertisements
Published in: on February 27, 2008 at 12:34 am  Comments (7)  
Tags: , ,