Tuesday, December 29, 2009

Using "Run As" from the command line

I needed to make some changes in Registry Editor on a machine, but didn't want to log out of the users account to get in as the admin. It's good that you can open a program such as Registry Editor via the Run box using the command "runas". Doing so allows you to start an application while providing administrative credentials, without the need to log out of the currently logged in user. In most cases you can right-click an application icon and choose "Run As...", but for something like Registry Editor you would either have to save a custom MMC or use this runas method.

The syntax is:

runas /user:localhost\administrator regedit


This will then prompt you for the administrator password, and assuming you know it, will give you access to the Registry Editor as an administrative user. You could also write this into a batch file and use that as a shortcut if you didn't want to type this into the Start->Run box each time you needed it.

To see the original article I found outlining this, along with more information about the batch file, check out this  www.tech-recipes.com article.

No comments: