Add Command Prompt Here Shortcut to Windows Explorer
by Daniel Petri - January 7, 2009
How can I add a Command Prompt option to the default Explorer right click context menu?
If you find that you frequently open a Command Prompt window and change to a specific directory, you can add the Command Prompt to your shortcut menu. This option enables you to right-click on a folder within Windows Explorer and choose the Command Prompt - which opens a Command Prompt window with that folder as your active directory.
To add the Command Prompt option to the default right click context menu in Windows Explorer you can do one of the following:
Note: For Windows Vista this feature is already built in the operating system. Read Quickly Open Command Prompt Here in Windows Vista for more info.
Method #1: Microsoft Powertoys
This is the easiest and most idiot-proof method.
Use the old Microsoft Powertoy called "DOSHERE". You can download it from HERE (1kb). Unzip it and then right click the INF
file and choose install.
You can also use the newer MS Powertoys found HERE. Download the Open Command Window Here
file and install it.
Method #2: Send to Toys
One of my favorite tools, one that I usually install right after finishing setting up any new system.
Send To Toys is an enhancement of the Send To system menu. It has many nice features including:
- Send To Toys Control Panel Applet allows you to manage the Send To system menu content, and configure Send To Toys settings.
- "Add to Send To menu" and "Remove from Send To menu" allows you to personalize the Send To system menu for drives, folders, and programs.
- Send To "Clipboard (as name)" copies the name of the file or files to the clipboard. Hold down the CTRL key to change the settings for this extension.
- Send To "Command Prompt" opens a DOS console window, setting the current directory to the selected folder. If the selection was a file, the folder containing the file will be the active directory and the name of the file will be typed for you at the prompt. Hold down the CTRL key to change the active directory to a different folder
- Send To "Favorites" adds a shortcut to your Favorites list. Hold down the CTRL key for the "Add Favorite" dialog.
- Send To "Folder..." sends a file or files to another folder, you will be shown a dialog box that lets you choose where the files should be copied. To move the files press and hold down the SHIFT key. The creation of a new folder is not supported on Windows 95, 98, and NT.
- Send To "Recycle Bin" send a file or files to the Recycle Bin. Hold down the CTRL key to perform a file shredding.
- Send To "Run..." sends a file or files to the Run command dialog
Send to Toys is freeware and can be installed on any version of Windows.
Download Send to Toys v2.4 (527kb)
Method #3: Manually add the context menu
- In explorer, open Tools, Folder Options.
- Select the File Types tab.
- For Windows XP: Go to NONE / Folder.
- For Windows 2000: Press n to scroll to the N/A section.
- For Windows NT/98/95: Press f to scroll to the Folders section.
- Select the entry labeled Folder
- For Windows 2000/XP: Press Advanced button.
- For Windows NT/98/95: Press Edit button.
- Select New
- In the action block type "Command Prompt" without the quotes.
- In the app block type "cmd.exe" without the quotes.
- Save and exit Folder Options.
Now right click on Start, you should have a new drop down option. Open explorer and right click on a folder, select Command Prompt and a command window opens in that folder.
Read this thread for some information on how to remove the context menu:
Command Prompt Quickie - Petri.co.il forums by Daniel Petri
Method #4: Through batch
file
- Begin by creating a batch file. For example, you could create a batch file named StartPrompt.cmd. Add the following commands to your batch file:
@echo off
cd /d %1
Title %~f1
- Save this batch file to your Windows NT/2000/XP root directory (which is usually C:\WINNT or C:\WINDOWS for XP).
- Open Windows Explorer.
- Choose View | Options to display the Options dialog box.
- Select the File Types tab.
- In the list of Registered File Types, select Folder then click Edit.
- Click New to display the New Action dialog box.
- In the Action text box, type Command Prompt.
- In the Application Used To Perform Action text box, type:
cmd.exe /a /k c:\winnt\
StartPrompt "%l"
- Click OK to close the New Action dialog box, then click Close twice.
Open Windows NT Explorer, then right-click on a folder. You should now see a new option called "Command Prompt" on the shortcut menu. If you choose this option, Windows Explorer opens a new Command Prompt window with the selected directory as your current directory.
Method #5: Through the Registry
- Navigate in your Registry to
HKEY_LOCAL_MACHINE/Software/Classes/Folder/Shell
and create a key called "Command Prompt" without the quotes.
- Set the default string to whatever text you want to appear in the right-click menu.
- Create a new key within your newly created command prompt named "command," and set the default string to
cmd.exe /k pushd %1
You may need to add %
SystemRoot%\system32\ before the cmd.exe if the executable can't be found.
- The changes should take place immediately. Right click a folder and your new menu item should appear.
Note: You can do the same for Windows 98. Type in "c:\windows\command.com /k pushd %1" (without the quotes).