Adding an "Elevated Command Prompt" here for Folders and Drives context menus in Windows Vista is pretty much the same way as you do in Windows XP. You will need administrative privileges (which means Elevated Privileges for Windows Vista) to add the entries in the registry because this is a system-wide change.
The "Elevated Command Prompt" here context menu is a very useful because when you right-click on a folder to select "Elevated Command Prompt" then the Command Prompt window will open with elevated permission at that folder’s location. For example, if you right-click on "c:\program files\program.folder" then the Command Prompt will open with elevated permissions at "c:\programs files\program.folder".
NOTE
To enlarge the images, simply click on the images you would like to view. With Internet Explorer 7, you can right-click on the image to select Open in New Tab.
CAUTION
Editing the Windows Vista registry can cause serious issues such as system instability when editing/deleting the wrong entries. Please use the Registry Editor with extreme caution.
CAUTION
Before making any changes to the Windows Vista Registry, please backup your Windows Vista Registry by creating a System Restore point using the direction from "Create a System Restore Point".
To Add "Command Prompt Here" to a Folder or Drive Context Menu with Elevated Privileges – Manual Method
NOTE
To enlarge the images, simply click on the images you would like to view. With Internet Explorer 7, you can right-click on the image to select Open in New Tab.
For Folders
- Open the Registry Editor with Elevated Privileges, refer to "Opening the Registry Editor with Elevated Privileges" blog article for instructions.
- Navigate to:
HKCR\Directory\shell
- Create a new key by right-clicking "shell" to select New > Key. Name the new key RunAs.
- Double-click (default)located at:
HKCR\Directory\shell\RunAs
- Enter the following in the Value Data filed:Elevated Command Prompt
- Create a new key by right-clicking "RunAs" to select New > Key. Name the new key command.
- Double-click (default)located at:
HKCR\Directory\shell\RunAs\command
- Enter the following in the Value Data field:
cmd.exe /s /k pushd "%V"
[HKCR\Directory\shell\RunAs]
Name: (default)
Type: REG_SZ
Data: Elevated Command Prompt
[HKCR\Directory\shell\RunAs\command]
Name: (default)
Type: REG_SZ
Data: cmd.exe /s /k pushd "%V"
For Drives
- Open the Registry Editor with Elevated Privileges, refer to "Opening the Registry Editor with Elevated Privileges" blog article for instructions.
- Navigate to:
HKCR\Drive\shell
- Create a new key by right-clicking "shell" to select New > Key. Name the new key RunAs.
- Double-click (default)located at:
HKCR\Drive\shell\RunAs
- Enter the following in the Value Data filed:Elevated Command Prompt
- Create a new key by right-clicking "RunAs" to select New > Key. Name the new key command.
- Double-click (default)located at:
HKCR\Drive\shell\RunAs\command
- Enter the following in the Value Data field:
cmd.exe /s /k pushd "%V"
[HKCR\Drive\shell\RunAs]
Name: (default)
Type: REG_SZ
Data: Elevated Command Prompt
[HKCR\Drive\shell\RunAs\command]
Name: (default)
Type: REG_SZ
Data: cmd.exe /s /k pushd "%V"
To Add "Command Prompt Here" to a Folder or Drive Context Menu with Elevated Privileges – Using Reg Add
- Open a command prompt with Elevated Privileges, refer to "Opening an Elevated Command Prompt" blog article for instructions.
- Type the following in the elevated commands prompt window:
- For Folders:
reg add HKCR\Directory\shell\RunAs /ve /d "Elevated Command Prompt"
reg add HKCR\Directory\shell\RunAs\command /ve /d "cmd.exe /s /k pushd \"%V\""
- For Drives:
reg add HKCR\Drive\shell\RunAs /ve /d "Elevated Command Prompt"
reg add HKCR\Drive\shell\RunAs\command /ve /d "cmd.exe /s /k pushd \"%V\""
To Add "Command Prompt Here" to a Folder or Drive Context Menu with Elevated Privileges – Using a Registration File – Method 1
NOTE
To enlarge the images, simply click on the images you would like to view. With Internet Explorer 7, you can right-click on the image to select Open in New Tab.
- Download RunAs.Cmd.Here.reg to a folder on your hard drive.
- Open a command prompt with Elevated Privileges, refer to "Opening an Elevated Command Prompt" blog article for instructions.
- Change directories to the folder where you saved RunAs.Cmd.Here.reg. For example, if you saved the RunAs.Cmd.Here.reg file to "c:\users\Bill", then type the following in the elevated command prompt window:
cd "c:\users\Bill"
- Then type the following in the elevated command prompt window to merge the registration file into the registry:
RunAs.Cmd.Here.reg
- Click Yes to confirm you want to merge the RunAs.Cmd.Here.reg file into the registry.
- A confirmation window will appear asking if you want to merge the RunAs.Cmd.Here.reg registration file into the Windows Vista registry. Click Yes to continue with the merge of the registration file. Refer to Image below.
- If you are successful with merge of the RunAs.Cmd.Here.reg registration file then the following window should appear. Refer to Image below.
NOTES
The RunAs.Cmd.Here.reg file is from my company web server (http://lprf.homeserver.com). You also can view the contents of the RunAs.Cmd.Here.reg file by right-clicking the file and selecting Edit. You may need to log off then log on to your user account or restart your computer for the changes to take affect.
To Add "Command Prompt Here" to a Folder or Drive Context Menu with Elevated Privileges – Using a Registration File – Method 2
NOTE
To enlarge the images, simply click on the images you would like to view. With Internet Explorer 7, you can right-click on the image to select Open in New Tab.
- Download RunAs.Cmd.Here.reg to a folder on your hard drive.
- If you have added "Run as Administrator" context menu for registration file using this article, "Adding "Run as Administrator" to a Registration File Context Menu" then right-click RunAs.Cmd.Here.reg to select Run as administrator.
- A UAC Prompt should appear to allow access to the elevated Registration merge. Click on Continue to allow the elevated Registration merge to continue. Refer to the Image below.
- A confirmation window will appear asking if you want to merge the RunAs.Cmd.Here.reg registration file into the Windows Vista registry. Click Yes to continue with the merge of the registration file. Refer to Image below.
- If you are successful with merge of the RunAs.Cmd.Here.reg registration file then the following window should appear. Refer to Image below.
NOTES
The RunAs.Cmd.Here.reg file is from my company web server (http://lprf.homeserver.com). You also can view the contents of the RunAs.Cmd.Here.reg file by right-clicking the file and selecting Edit. You may need to log off then log on to your user account or restart your computer for the changes to take affect.
NOTE
To enlarge the images, simply click on the images you would like to view. With Internet Explorer 7, you can right-click on the image to select Open in New Tab.
Related Articles
Platforms Tested
- Microsoft Windows Vista, x86 versions
Version 1.5
Edited: May 3, 2012
Recent Comments