Get Path by Dragging Files or Folders into Command Console Window

Contributor Icon Contributed by David Kirk    Date IconJanuary 31, 2012  
Tag Icon Tagged: Windows  

Dragging files or folders into the command prompt window automatically inserts the correct path of that object. This technique works with all versions of Microsoft Windows including XP, Vista, and Windows 7.

I enjoy using the command console or command terminal, but I hate typing in all those long paths. Here’s how to get around it.

drag and drop into terminal

1. Open your command console or prompt.
2. Drag any file or folder into the command console.
3. The path of that item will be displayed in the command window.

Say I wanted to navigate my command box to C:\Program Files\Internet Explorer\PLUGINS\RichFX\Player

It might take me forever to type all of that. Plus, knowing me I would have a typo or two. Even easier, I can just open my console window, type cd, and then drag the folder into the console window. Here is an example of what it would look like:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
.
C:\Documents and Settings\AlexTheBeast>cd "C:\Program Files\
INS\RichFX\Player"
.
C:\Program Files\Internet Explorer\PLUGINS\RichFX\Player>

Using this technique you never type out those long directory structures again.

 

3 Comments -


  1. Farouk said on January 31, 2012

    if you want you can also open the command console in the C: drive directly without using “cd\” by adding a string value to the registry named “Autorun”.

    Great trick thanks.

    Farouk

  2. Sugihartono said on February 1, 2012

    Dear David,
    cd command follow by path only work if new path in same drive, otherwise it will not work. Worked command is cd /d follow by path. It will work for new path in same drive or not in same drive

  3. todd kaufmann said on February 5, 2012

    This also works in OSX (Dragging a file or directory from Finder to Terminal window).

    Also in Linux (with gnome, and gnome-terminal anyway; not xterm).

    Also, from a windows cmd window, to bring up an explorer window on the current directory, type the command
    explorer .

 

RSS feed for comments on this post. TrackBack URL

Leave a comment -