Windows Explorer “Command Prompt Here” [closed]

0 votes
asked Dec 18, 2008 by recursive

I frequently find myself with a folder open in Windows, wishing to have a command prompt open with the same working directory.

I am aware of Power Toys "Command Prompt", but that only works as a context menu item on the folder, and not from inside the folder if you are already there. I know you can navigate to the parent directory, and use it from there, but if the parent has thousands of directories in it, this is not so convenient. I have tried some home-brewed batch files associated with folder actions in explorer, but those suffer from similar problems.

So, what is the quickest way to open a command prompt with a working directory of the current windows explorer folder?

My current approach: (horrible)

  • Alt - D, Ctrl - C (copy path)
  • Win - R, "cmd", Enter (start command prompt)
  • "cd", Space (start a change directory command)
  • Alt - Space, e, p (paste directory)
  • Enter (execute change directory)

I know there is something better! What is it?

16 Answers

0 votes
answered Jan 18, 2008 by palehorse

I use StExBar, a Windows Explorer extension that gives you a command prompt button in explorer along with some other cool features (copy path, copy file name & more).

http://tools.tortoisesvn.net/StExBar

EDIT: I just found out (been using it for more than a year and did not know this) that Ctrl+M will do it with StExBar. How's that for fast!

0 votes
answered Jan 18, 2008 by gennady-shumakher

If that's so bothering, you could try to switch to windows explorer alternative like freecommander which has a toolbar button for that purpose.

0 votes
answered Jan 18, 2008 by sam-meldrum

Almost the same as yours:

  • Alt+d, Ctrl+c
  • Win+r
  • cmd /K cd , Ctrl+v, ENTER
0 votes
answered Dec 19, 2008 by rob-kennedy

Right-click the title-bar icon of the Explorer window. You'll get the current folder's context menu, where you'll find the "command window here" item.

(Note that to see that menu item, you need to have the corresponding "power toy" installed, or you can create the right registry keys yourself to add that item to folders' context menus.)

0 votes
answered Dec 19, 2008 by clawr

Hold Shift while Right-Clicking a blank space in the desired folder to bring up a more verbose context menu. One of the options is Open Command Window Here. This works in Windows Vista, 7, 8, and 10. Since Windows 10 Creators Update, the option has been replaced with Open PowerShell Here. However, there are ways to enable Open Command Window Here again.

0 votes
answered Dec 19, 2008 by dr-evil

Just type "cmd" to location bar, that's it. It will start a new command prompt in current path.

This solution was confirmed to work in Windows XP, Vista, 7, 8 and 10 (including Creators Update).

Keystrokes to move the focus to the location bar:

  • AltD in English (pointed out by Tim Stewart in the comments)
  • AltE in German
0 votes
answered Jan 26, 2011 by ctype-h

You can edit the registry to add the Command Prompt item to the context menu. Here are a couple of .reg files that I use.

Cmdhere.reg - for WinNT/2000/XP/Vista/7:

Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\shell\OpenNew]
@="Command Prompt"
[HKEY_CLASSES_ROOT\Directory\shell\OpenNew\Command]
@="cmd.exe /k cd %1"
[HKEY_CLASSES_ROOT\Drive\shell\OpenNew]
@="Command Prompt"
[HKEY_CLASSES_ROOT\Drive\shell\OpenNew\Command]
@="cmd.exe /k cd %1"

Doshere.reg - for Win9x:

REGEDIT4
[HKEY_CLASSES_ROOT\Directory\shell\OpenNew]
@="MS-DOS Prompt"
[HKEY_CLASSES_ROOT\Directory\shell\OpenNew\Command]
@="command.com /k cd %1"
[HKEY_CLASSES_ROOT\Drive\shell\OpenNew]
@="MS-DOS Prompt"
[HKEY_CLASSES_ROOT\Drive\shell\OpenNew\Command]
@="command.com /k cd %1"

Copy this into an empty text file and change the extension to .reg. Double-clicking on this in Windows Explorer will add these key to the registry.

0 votes
answered Jan 5, 2013 by raymond-gauthier

On vista and windows 7:

  • Alt+d -> it will put focus on the address bar of the explorer window
  • and then, type the name of any program you would launch using WIN+r
  • hit Enter

The program will start with its current directory set to that of the explorer instance. e.g.:python, ghci, powershell, cmd, etc...

0 votes
answered Jan 7, 2013 by hemn

This solution also work for background menu: http://www.roggel.com/NGNeer/BackgroundCMD/

0 votes
answered Jan 23, 2013 by ivan-ferrer-villa

I use a lot the "Send To" functionality.
I create my own batch (.bat) files in the shell:sendto folder and send files/folders to them using the context menu (to get there just write 'shell:sendto' in location bar).
I have scripts to perform all sort of things: send files by ftp, launch a php server in the current folder, create folders named with the current date, copy sent path to clipboard, etc.
Sorry, a bit offtopic but useful anyway.

Welcome to Q&A, where you can ask questions and receive answers from other members of the community.
Website Online Counter

...