Get Path by Dragging Files or Folders into Command Console Window
Posted by David Kirk in 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 find typing in the long paths time-consuming. The following recipe describes how to avoid this.
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.
Numerous uses of this technique exist. For example, a user needs to navigate the command box to C:\Program Files\Internet Explorer\PLUGINS\RichFX\Player.
Typing this path takes time, and the risk of making a typo is great. A simpler way to accomplish this task is to open the console window, type cd, and then drag the folder into the console window. The following is an example of this process:
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 saves time by eliminating the need to type a long directory structure.
About David Kirk
View more articles by David Kirk
The Conversation
Follow the reactions below and share your own thoughts.

January 31, 2012 at 7:36 pm, Farouk said:
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
February 01, 2012 at 2:06 am, Sugihartono said:
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
February 05, 2012 at 3:53 pm, todd kaufmann said:
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 .
February 17, 2012 at 4:24 pm, tetricacy said:
I don’t use cmd much, but I hope I remember this when I do. How convenient! Thanks!