Enter Your Administrator Credentials Only Once

Here's a trick you can use to avoid repeatedly entering your administrator account credentials each time you need to use the Run As option to launch an application that requires administrative privileges.

Readers

August 29, 2007

2 Min Read
ITPro Today logo


You're a domain administrator. Followinggood security practices, you log on to yourWindows XP workstation with your restricteddomain user account, not with your domainadministrator account. To avoid logging offand on repeatedly, alternating between youruser and your administrator accounts, youlaunch programs that require administratorcredentials by using those programs' Run Asoption.

Here's a simple trick you can use to avoid repeatedly entering your administrator account credentials each time you need to use the Run As option. Begin by creating a shortcut to cmd.exe on your desktop. (You can find cmd.exe in the C:WINDOWS system32 folder.) Right-click the shortcut icon, and select the Run as option. Enter your administrator credentials and click OK. Keep this command-shell window open or minimized. From this point on, you don't need enter your administrative credentials again. To launch an application that requires an administrator account, simply drag and drop the application's icon onto the open command-shell window and press Enter. (If the command-shell window is minimized, you can drag and hover the application's icon over the command-shell window button in the taskbar. After the command-shell window opens, drop the application's icon onto the window.) Every application you launch this way will run under your domain administrator account.

To launch the shortcut icon with a double-click (instead of using its Run As option) and to get the command-shell window to always start positioned in a specific directory, right-click the command-shell window's shortcut icon and select Properties. In the Target field enter runas.exe /user:your_domain_name your_domain_admin_userid "cmd.exe /k cdyour_dir" (replacing your_domain_name, your_domain_admin_userid, and your_dir with the appropriate information).

Finally, to distinguish this command-shell window from other command-shell windows you might have open, give it a different colored background. To do so, use the shortcut to open the command-shell window, right-click anywhere on the title bar, and select Properties. Click the Colors tab. Select the Screen Background radio button, select a color (e.g., red), and click OK. You'll get a dialog box that basically asks whether you want this change to apply to just the current window or future windows as well. Select the option that provides the latter. The option might read Modify shortcut that started this window or Save properties for future windowswith same title, depending on your machine.
—Andre Boutet, Technical Analyst, CSST Quebec

Sign up for the ITPro Today newsletter
Stay on top of the IT universe with commentary, news analysis, how-to's, and tips delivered to your inbox daily.

You May Also Like