Drag and Drop to a Command Prompt in Vista

Everyone has their opinions about their favorite Microsoft products and for me at least, Windows Vista ranks in there with Windows ME.  One of the irritations I have had has been the “feature” Microsoft added that disabled the functionality of drag and drop onto an open command prompt.

As a network administrator I found it very useful to sometimes click on a file or a folder and drag the icon over to a command prompt.  By typing a CD at the command prompt and then dragging a folder over from an open window, I was able to save time by not having to key in long path names.   In Windows Vista and Server 2008 this functionality was removed.

I’ve always been a purist of sorts.  Since I’m responsible for hundreds of desktops and servers, I prefer to work with the tools that come defaulted with the systems that I manage.  When I log onto a desktop I want to be able to use the same tool to fix something that I used last time.  That’s why I really don’t like workarounds where you have to depend on a software package that you installed on your local machine.  But enough of my rants.

 Let’s talk about how you work around this issue in Windows Vista.

 Copy a File or Folder Path in Windows Vista

This is a cool feature that is built into Vista’s shell that adds a Copy as Path option to the right-click context menu.  The only issue is that it is only enabled when you use the right pane.  It is disabled in the left pane of Windows Explorer and in a My Computer window.

  1. Open an instance of Windows Explorer
  2. Browse to the required file 
  3. Right-click on the file in the right pane of the Windows Explorer window
  4. Hold down the SHIFT key while you right-click the folder
  5. ScreenHunter_07 Oct. 02 13.09 

  6. Choose Copy as Path from the context menu.
  7. Now you have the object’s path on the clipboard.  You can open the Command Prompt, and either left or right-click on the icon in the top left-hand corner of the title bar.

     

  8. Lastly, choose Edit and then Paste on the menu.

ScreenHunter_09 Oct. 02 13.17

The path to the file or folder will then be pasted to the Command Prompt.  Alternately, you can just right-click in the Command Prompt and choose Paste.