Learn What IT Pros Need to Know About Windows 11 - August 26th at 1 PM ET! Learn What IT Pros Need to Know About Windows 11 - August 26th at 1 PM ET!
Windows 7

Drag and Drop to Command Prompt - It's Back in Windows 7!

Working with the Command Prompt is one of an IT Professional’s required skills. In previous Windows operating systems, one could drag and object to an open Command Prompt window in order to ease our work. This feature was nice to have especially when running executable files nested deep within a folder hierarchy. Instead of manually navigating the Command Prompt path to the required folder, you could simply drag and drop the necessary file to the Run option or to the Command Prompt and press Enter to run it.

Somehow, this useful feature wend away in Windows Vista and Windows Server 2008. I wrote about this in my Missing Drag and Drop in Vista Command Prompt article. In Vista/2008, if you try to drag a file from anywhere in Windows Explorer to an open Command Prompt window you see that the pointer icon changes to a “no entry” symbol:


When asked, Microsoft officials provided dull answers and claimed that this is “by design” and that it was in fact “a feature”. Some claimed that “This was done to reduce the command window’s dealings with the dragged data object”. This last excuse is, in my opinion, pure crap especially when compared to the huge overhead provided by other so-called “advanced” features of Vista such as the process-intensive Aero theme (read my Aero Theme is bad, disable it article or to the huge overhead of the TCP Window Auto tuning functionality that wrecks havoc to your network copy and browse functions (read my Browsing websites and downloading files is painfully slow with Windows Vista. Other answers included things like “you can shift-right-click to get the copy as path function instead” (read my Quickly Copy File and Folder Path in Windows Vista. Another claim was that the drag and drop feature was dropped because it poses a “security risk”. Maybe, I don’t know, but since it’s been present since the days of older operating systems I don’t see why it wasn’t removed before if it was such a huge security risk.

Sponsored Content

Read the Best Personal and Business Tech without Ads

Staying updated on what is happening in the technology sector is important to your career and your personal life but ads can make reading news, distracting. With Thurrott Premium, you can enjoy the best coverage in tech without the annoying ads.

You can imagine that I did not have high expectations set when I booted up my Windows 7 (currently beta build 7000) virtual machine and fired a CMD window. I tried dragging a file name onto the open CMD window, and behold, it works!




Other methods worth mentioning are also listed in my How can I quickly copy a file or a folder’s path in Windows Vista? article which describes a trick that still works in Windows 7;

Open a Windows Explorer windows, browse to the required file. Hold the SHIFT key while you right-click the folder.


You can now paste the copied path anywhere you want, including to a Command Prompt window.


Related Topics:


Don't have a login but want to join the conversation? Sign up for a Petri Account

Comments (1)

One response to “Drag and Drop to Command Prompt – It’s Back in Windows 7!”

  1. 4sysops - My favorite 7 Windows 7 tips

    [...] Daniel Petri discovered that drag and drop to the command prompt is back in Windows 7. This allows you to copy a file’s path to the command prompt. [...]

Leave a Reply

Register for Advanced Microsoft 365 Day!

GET-IT: Advanced Microsoft 365 1-Day Virtual Conference - Live August 24th!

Join us on Tuesday, August 24th and hear from Microsoft MVPs and industry experts about how to take advantage of Microsoft 365 at a technical level and dive deep into the features and functionality that will make your environment more secure and compliant.


Sponsored By