views:

4988

answers:

10

Without having to navigate all the way to the directory I want.

+11  A: 

You may want to look at this "PowerToy" from Microsoft:

Open Command Window Here

This PowerToy adds an "Open Command Window Here" context menu option on file system folders, giving you a quick way to open a command window (cmd.exe) pointing at the selected folder.

dF
I think this answer combined with Michael Ratanapintha's answer about using shift-right click in vista and 2008 answers this question fully.
Joshua Hudson
+11  A: 

This might be what you want:

cmd /K "cd C:\Windows\"
Allain Lalonde
Thanks ... Even shorter from GUI : WinLogo + R , type : cmd /c "start /max cmd /K "cd C:\Windows\""
YordanGeorgiev
A: 

Already answered here

PabloG
+2  A: 

Use the /K switch. For example

cmd /K "cd /d c:\WINDOWS\"

Will create a cmd window at the C:\Windows directory

Jason Punyon
A: 

Create a shortcut and edit the "Start In" property of the shortcut to the directory you want the cmd.exe to start in.

simon
+4  A: 

If you have Vista or Server 2008, right-click on the directory icon in Explorer while holding the Shift key, and then click the "Open Command Window Here" context menu option. For XP, use the PowerToy mentioned by dF to get the same function.

crosstalk
I'm running Server 2008 here and I don't get an "Open Command Window Here" context menu option when I Shift+right-click on a directory... ...doesn't work on Vista x64 either.
raven
Works fine in Vista x64 Home Premium, and I assume other versions as well. It's about midway down the list. Note that a file cannot be selected when you right click.
Dan Homerick
+1  A: 

Right click the desktop and navigate to new and then from the sub-menu select "shortcut">>Browse to the windows directory (or folder) and then to the system32 directory and click ok. add a \ and "cmd.exe" (without the qoutes) to the command string. Should look like this...C:\WINDOWS\System32\cmd.exe. Click next and finish. Right click the new CMD icon on your desktop and select properties, and next to the Start In options delete the line and add the path to where ever the directory is that you want it to start in...I.E., c:\temp\mp3 and click ok.

+3  A: 

The XP powertoy is a good option, but I thought I'd post another, in case you'd like to "roll your own". Create a text file, name it anything.reg, paste in the code below, save it, then double-click on it to add it to the registry (or just add the info to the registry manually if you understand what's going on in this .reg file).

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\Folder\shell\Command_Prompt_Here...]
@="Command Prompt Here..."

[HKEY_CLASSES_ROOT\Folder\shell\Command_Prompt_Here...\command]
@="cmd.exe \"%1\""
raven
A: 

you can do this also

[HKEY_CLASSES_ROOT\Directory\shell\cmd]
@="command prompt here"
[HKEY_CLASSES_ROOT\Directory\shell\cmd\command]
@="cmd.exe /c start \"%1\" cmd.exe /k cd /d %1"
[HKEY_CLASSES_ROOT\Drive\shell\cmd]
@="command prompt here"
[HKEY_CLASSES_ROOT\Drive\shell\cmd\command]
@="cmd.exe /c start \"%1\" cmd.exe /k cd /d %1"
crowdy
A: 

There are atleast 5 ways to do this.

mixdev