Open elevated command prompt from any folder in Windows Vista

When a Windows Vista user shift-clicks on a folder in Explorer, the context menu option "Open Command Window Here" comes up. Clicking on it gives you a command prompt that's started in the desired folder—a handy way to quickly get a command prompt to a buried folder that has a long pathname.

The bad news is that the command prompt is only a regular-user prompt, not an elevated (administrative) command prompt. If you want to do anything that requires an admin-level login, you have to open it manually from the Start menu and drill down to the needed folder. This is a problem for me because some of my system's folders have Unicode pathnames, which I have trouble drilling down to from a command prompt.

Thankfully, the Winhelponline.com blog has published a way to

Requires Free Membership to View

add an admin-level command-window prompt to any folder's context menu. The simple process involves creating a REG file which you then merge into the Registry.

The blog offers two versions of this trick: one for adding an elevated prompt to a folder context menu, another for adding an elevated command prompt to the My Computer context menu. Both incarnations of the trick use the RunAs command as a context menu handler for a command prompt. RunAs does the actual elevation, since CMD itself doesn't have a switch for running an instance of itself in Admin mode.

Once you install the Registry patch, you should see an "Open Command Windows Here (Administrator)" option along with the User Account Control (UAC) "shield" icon in the right-click context menu for a folder (or Explorer, depending on which script you're using).

Note: If you use this trick, you'll still be prompted for a UAC confirmation whenever you invoke the admin command prompt from a context menu—assuming, of course, UAC is turned on.

About the author: Serdar Yegulalp is editor of the Windows Insight, (formerly the Windows Power Users Newsletter), a blog site devoted to hints, tips, tricks and news for users and administrators of Windows NT, Windows 2000, Windows XP, Windows Server 2003 and Vista. He has more than 12 years of Windows experience under his belt, and contributes regularly to SearchWinComputing.com and SearchSQLServer.com.

More information on this topic:

This was first published in May 2007

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.