Open Elevated Command Prompt Window Here as Administrator at Current Folder Directly in Vista Windows Explorer
In Windows Vista, if User Account Control (UAC) is not disabled, there will be occasional need to open an elevated command prompt window with full administrator rights. When an elevated command prompt is opened, it will normally go to \Windows\System32\ folder by default. Windows Vista has built-in hidden function to show open command prompt or command window here to the contextual menu of the folder so that users can easily open a command prompt shell at current location when browsing directories in Windows Explorer or Computer (aka My Computer) straight direct into the directory without having to type a lot of “cd” (change directory) command, especially when the directory is deeply nested and low in hierarchy.
With the following trick, it’s also possible to add a context menu option item permanently to right click contextual menu of folders in Windows Explorer and Computer to bring up a Open Command Window Here as Administrator option which will not only open a command prompt at current Windows Explorer location which you’re viewing at, but also run the command window in elevated mode with full administrator privileges after granting permission with UAC dialog.
To add a contextual menu item to the file system folders’ right click menu that launch an elevated command window here at current directory as administrator, simply download the following registry registration file.
Download elevated-command-here.zip from the forums.
Unpack the archive and double click on elevated-command-here.reg file to apply the registry setting. You can also right click on the .reg file and select “Merge”. Click “Continue” on User Account Control “Windows needs your permission” pop-up dialog, and then confirm the Registry Editor modification request by pressing “Yes” when asked whether sure want to continue on window with message saying “Adding information can unintentionally change or delete values can causes components to stop working correctly. If you do not trust the source of this information in elevated-command-here.reg, do not add it to the registry”.
What the registry file is doing is shown in the code block below. You can also copy and paste the following code to a text editor, and save the file with a filename with .reg extension. Then double click on it to merge the values to the registry.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\runas]
@="Open Command Window Here as Administrator"
[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
@="cmd.exe /s /k pushd \"%V\""

Once merged, open Windows Explorer, Computer, Documents, Pictures, Music, or Games in Windows Vista Start Menu, then right click on any folder, and you will see Open Command Window Here as Administrator contextual item option which will bring you direct to the destination directory which you right click at or currently in with full admin rights. A pretty convenient and useful shortcut trick.
Related Articles
- How to Open Elevated Command Prompt with Administrator Privileges in Windows Vista
- Run Command Prompt Window as Administrator by Right Click Computer in Vista
- Create and Put an Elevated Command Prompt on Windows Vista Desktop or Start Menu
- Add Open Command Window Here to XP Folder with PowerToy
- Reveal and Access to Windows Vista Hidden Context-Sensitive (Right Click) Menu Item – Open Command Prompt Here & Copy as Path
- How to Fully Maximize Command Prompt Window in Vista
- Show Current Working Folder or Directory Full Path in Batch Command Script
- How to Disable or Enable Vista User Access Control in Command Prompt
- Add Window Switcher (Flip 3D) Command to Vista Right Click Menu
- Trick to Open Computer or Documents as Default Instead of Libraries Folder with Windows Explorer on Windows 7










































November 6th, 2007 22:48
hey! landed up here when i googled a strange command line option in vista. when i used vista manager to edit the contextual menu options, i saw the same command you have used as an option already enabled with the display name as “@shell32.dll, -8506″. is this normal, coz when i actually right click at places, or on folders, i never see this entry as an option…
October 18th, 2007 00:28
[...] key and right click on a folder open a command window here, a registry hack will allow you to open command window at current folder in elevated mode as administrator. Get help or contribute tips or tricks at My Digital Life [...]
October 18th, 2007 00:24
[...] You can also use registry hack to open “elevated command window here as administrator“. [...]