- Home
- Windows Vista
- Customize
- How to open an elevated Command Prompt from the folder context menu in Windows Vista
How to open an elevated Command Prompt from the folder context menu in Windows Vista
Summary
This article tells you how to add an Open Command Prompt here (Administrator) option to the context menu for folders and to the Computer (previously My Computer).
Launch an elevated Command Prompt from the context menu
To add the Open Command Window Here (Administrator) option to the context menu for file system folders, use the following REG file:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\runas]
@="Open Command Window Here (Administrator)"
[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@="cmd.exe /s /k pushd \"%V\""
To add the entry to Computer (My Computer) context menu, use the following REG file:
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\runas]
@="Open Command Prompt (Administrator)"
[HKEY_CLASSES_ROOT\CLSID\{20D04FE0-3AEA-1069-A2D8-08002B30309D}\shell\runas\command]
@="cmd.exe"
Usage
Copy the above contents to Notepad, and save the file with .REG extension. Then right-click the REG file and choose Merge.
Screenshots

The User Account Control (UAC) elevation prompt is presented to the user when clicking on this context menu option.
Related Articles
- How to add the Print Directory feature for file system folders in Windows Vista
- VBScripts and UAC elevation
- How to open an elevated Command Prompt in Windows Vista
- Error "Registry editing has been disabled by your administrator" when you open the Registry Editor in Windows Vista
- Error "Access is denied" when you try to log off an user account using Task Manager Users tab in Windows Vista
- How to add "Open Command Window Here" context menu option on file system folders in Windows Vista
If you enjoyed this post, make sure you
subscribe to our RSS feed!
We feature Tips, Troubleshooting information, Scripts and Utilities for Microsoft Windows Operating Systems!
Prefer an E-mail subscription?
1 Response to "How to open an elevated Command Prompt from the folder context menu in Windows Vista" 
|
said this on 28 Aug 2007 7:59:10 AM PST
Change the "Directory" to "Folder" - [HKEY_CLASSES_ROOTFoldershellrunas] - and the context menu will also work in the folder tree.
|

Author)