Many people that use Windows also use the Command Prompt / Command Window / DOS Prompt (or whatever you choose to call it). I use the prompt often myself (as you can see from previous posts), so it’s important to be able to navigate through folders via the prompt. I could choose to open a prompt and use cd all the time to navigate directories, or I could use a program to open a prompt already at the folder I’m in. To go even further, I could download the Microsoft PowerToy “Open Command Window Here,” or I could write it myself. I think I’ll write it myself, seeing that it takes about two lines of Registry code.
You have three choices: (1) make your own Registry script using the given code, (2) manually enter keys into the Registry the long way (a good way to learn though), and (3) download and run the script I already made for you.
(1) The .reg code view
Make your own Registry file (a .reg extension) with the following code:
Windows Registry Editor Version 5.00
@="Open Command Prompt Here"
@="cmd.exe /k pushd %L"
(2) Manual Registry instructions
1. Start > Run > “regedit” [Enter]
2. Open HKEY_LOCAL_MACHINE/Software/Classes/Folder/shell/
3. Right-click on Shell > New > Key
4. Name it Command Prompt (or anything you think is descriptive for yourself)
5. In the right frame, for the default value, of the Command Prompt key you just made, enter whatever text you want to appear in the context menu (e.g. Open Command Prompt Here -or- Commaaaaaannnd!)
6. Back in the left frame, right-click Command Prompt (or whatever you called it) > New > Key
7. Name this sub-key: command [Note: it must be named command to work]
8. In the right frame of command, set the default value to cmd.exe /k pushd %L
Screenshots of what your registry should look similar to (click images to enlarge):
(3) The lazy way: download and run the .reg
If you don’t want to do anything yourself, just download the registry file (.reg) and say OK to the warning. It will add the code to your registry for you.
About the Registry script
I’ve only tested this script on Windows XP Pro for my own use. Your experience may differ, so I hold no responsibility if you screw something up in your registry. This article was revisited from a previous comment of mine on Lifehacker.
The script in a nutshell:
The first line makes a registry key for the Windows Explorer shell. This name appears on the right-click context menu when you right-click a folder. The second line places the code that gets executed when you click the menu item. This line of code launches the command prompt (
cmd.exe) in interactive mode using the
/k switch. The
pushd command stores the name of the current directory, and %L places that stored name into the variable spot.