Thursday, April 16, 2009

MSWindows Doesn't Have "su"...Now What?

MSWindows, damn it, doesn't really have anything equivalent to the "su" command in Linux. With su, while I am logged in as a normal user, I can temporarily get admin rights by opening up a konsole, and typing "su" followed by the root password.

So, in Windows XP, what can you do if, while logged in as a user, you need to modify a file that that was created by the administrator?

Normally, I'd say you're screwed, and you have to log out, and then log back in again as administrator. But I have recently discovered a little hack that gets you admin access as a normal user.

Right-click on the icon for IE, either in the Start Menu or on the quick launch bar--this won't work on the desktop icon--and select "Run As..." This will pop-up a dialog asking which user to run the application as. Click on "The following user" and select the local administrator for the machine. Enter the administrator password and hit OK.

MSIE will pop up. Hit the stop button, then, in the location bar, enter "C:". This will bring up the contents of the C: drive. From there, you can delete files, change permissons, etc.

Much easier than logging out.