Windows Vista Secret #1: Open Command Prompt Here

Windows Vista Secret #1: Open Command Prompt Here

Rate This
  • Comments 34

I don't know about your workflow as a developer, but I often find myself switching back and forward between an Explorer window and the command shell. For example, sometimes I'm looking around the filesystem for a project that I created a while back and then I want to build it from the command line or rename some of the files or something.

Here's a trick that I don't think many people are aware of. Right-click on any folder on your Windows Vista machine while holding down the shift key. You'll see an extra context-sensitive menu item there: Open Command Prompt here. Just click on this menu and a command window will open with the current working directory set to the folder's actual location.

Figure: folder context-sensitive menu, with and without the shift key modifier.

In the past there was a Windows XP powertoy that did this; now it's built into the operating system (albeit hidden away to protect the unwary from themselves). What's really cool about this is that if the target folder is a network location, Windows Vista silently maps a network drive to that location before opening the folder (so that your command prompt has a valid path containing a drive letter) and then deletes the network drive once the command prompt is closed.

  • I really do like that this is included in Vista without the need of a powertoy, but is there any way to use it to get an elevated command prompt? Sometimes you just need full Admin rights, and having a way to do that would be very nice.
  • Awesome!! those are great secrets to know this one and your new one!!


  • It would also be great if this worked in the TreeView to the left if you choose Show Folders in the shell...
  • Nice! But when do we get "Open PowerShell Prompt" here? :)
  • Tim Sneath vient de publier 2 astuces pour Windows VISTA:Open Command Prompt Here Copy as Path Je dois...
  • I think I remember there being a way to get all command prompts to run the vsvars batch file so that the command prompt is actually usable. Do you remember what this is? I think it was a registry setting...
  • Josh, you're correct - it's a registry setting.

    In HKLM\Software\Microsoft\Command Processor, add a new String value named AutoRun. Set the contents to the batch file you'd like to run (e.g. d:\tools\mycustomvsvars.cmd).
  •   3 petites astuces sous Vista. A mon avis, ca ne fait que commencer, il va y avoir plein de petit...
  • Did anyone also notice the other option "Copy as Path"?
  • Nice posts on this and Copy As Path -  makes me want to install Vista on my main PC!

    Re "if the target folder is a network location, Windows Vista silently maps a network drive" - just wanted to share the tip that "pushd" will do this from the command line. It's like "cd" but accepts network paths. "popd" will unmap the drive. (This is not new for Vista though, it's available on XP's command shell and maybe earlier).
  • Thanx !
    Japanese RC1 enable too !
  • Unfortunately, the usefulness of this feature is limited because it will not work from folders or drives in the "Folder Pane" of Windows Explorer as it did in the Power Toy version for Windows XP.

    For a way to add the full Power Toy functionality, consult my blog at

    My technique does does not automatically map network drives though.
  • PingBack from
  • Nice,

    it's the little things that make RC1 so much fun ;-)
  • PingBack from
Page 1 of 3 (34 items) 123