You can drag/drop to the command prompt

Date:November 24, 2003 / year-entry #140
Tags:tipssupport
Orig Link:https://blogs.msdn.microsoft.com/oldnewthing/20031124-00/?p=41733
Comments:    17
Summary:The command prompt is a drop target: Dropping a file onto it inserts the filename.

The command prompt is a drop target: Dropping a file onto it inserts the filename.


Comments (17)
  1. SteveM says:

    How come I didn’t know that? Thanks Raymond!

  2. Peter Torr says:

    The annoying thing is that the window doesn’t get focus. So you select something (eg from Explorer) and drag-drop it on to the cmd window, then hit <enter>

    Too bad if the CMD line said "notepad " and you drag-dropped "format_hard_drive.vbs", because you just RAN the script rather than edited it :-(

    This is not only annoying, it’s inconsistent with other applicatins (eg, drag-drop from Word to Excel, and Excel gets the focus)

  3. Michael Moulton says:

    The window gets focus when I try it under XP.

  4. Michael Moulton says:

    The window gets focus when I try it under XP.

  5. Mike Dunn says:

    You can do the same thing with the Start|Run dialog. :)

  6. TheCodeFoundry says:

    Raymond,

    Why was a keyboard shortcut never created for use in Windows Explorer that allows you to create a new folder?

    Aggravating when you are creating a bunch of new folders to have to right click, select New, wait for all the stupid templates to load, then select New Folder. You can rename files via F2, why wasn’t a shortcut ever created for New Folder?

  7. Trevor Schrock says:

    Alt-f-w-f will create a new folder quickly via the file menu. Creating new folders isn’t something one usually has to do a lot, I suspect. Not enough to memorize a ctrl-code for, anyway.

  8. Mike Dimmick says:

    It depends how you do your archiving. At present, my employer doesn’t use source control…

    …waits for everyone to get back on their chairs…

    …so we make daily backups of our projects to a shared server using a folder with that day’s date. OK, if it’s a spike, I might not back up for a few days – in a source control system, I would branch, spike on that branch, then either merge the branch or obliterate it.

    So I end up doing New Folder quite often.

  9. Jack Mathews says:

    Raymond, a really really useful coding one would be opening a URL in the web browser control, then making it so when you click any of the anchors, they are handled differently (like opened in a different browser, or just put in a message box) rather than handled by that control.

    I would LOVE to see code to do that in C/C++. Wrapping my head around the internals of the WebBrowser object took a lot more time than I was thinking it would.

  10. Nate says:

    Is there a way to paste to the command-line? Currently I have to do Left Alt+Spacebar, E, P. (NB: Right-Alt won’t work with the US-International keyboard layout).

    It would be nice if Ctrl-V worked, although I guess it conflicts with some ancient command-line apps. I’m really looking forward to msh. I hope it’s a clean break from the bad old DOS days!

  11. Nate says:

    Is there a way to paste to the command-line? Currently I have to do Left Alt+Spacebar, E, P. (NB: Right-Alt won’t work with the US-International keyboard layout).

    It would be nice if Ctrl-V worked, although I guess it conflicts with some ancient command-line apps. I’m really looking forward to msh. I hope it’s a clean break from the bad old DOS days!

  12. PeterM says:

    In Win2K, right click in the "CMD" window and whatever text is in the clipboard will be copied to that window.

     Thanks,
     PeterM
    
  13. Jordan Russell says:

    While on the subject of mouse movement…

    Why is it that in Windows XP & 2003 it’s no longer possible to select items from dropdown combo boxes using a single click/move/release motion? If you attempt this, it just moves the list’s focus rectangle around (huh?), and nothing happens when you release the button.

    I’d love to know the reasoning behind the change, or if it’s simply a bug…

  14. Mark Hurd says:

    Mike: I have an empty folder called Spare on my Desktop and in drives and folders where I need new folders often or quickly. Then I can just Copy’n’Paste it, or drag’ndrop with Ctrl held.

    In my case, this is much faster than Create New Folder because something (not sure if it is a 3rd party add-on or a Microsoft feature I’ve turned on) causes Explorer to "lock up" for up to a minute before I can rename the new folder. This doesn’t happen with copied folders.

  15. TheCodeFoundry says:

    Jordan,

    I think it only works on certain combos, as the drop down combo in IE 6.x supports that under WinXP. But I have noticed that the behavior is inconsistent across applications.

  16. Raymond Chen says:

    The keyboard shortcut to create a new folder is Alt+F,W,F. I use it all the time.

Comments are closed.


*DISCLAIMER: I DO NOT OWN THIS CONTENT. If you are the owner and would like it removed, please contact me. The content herein is an archived reproduction of entries from Raymond Chen's "Old New Thing" Blog (most recent link is here). It may have slight formatting modifications for consistency and to improve readability.

WHY DID I DUPLICATE THIS CONTENT HERE? Let me first say this site has never had anything to sell and has never shown ads of any kind. I have nothing monetarily to gain by duplicating content here. Because I had made my own local copy of this content throughout the years, for ease of using tools like grep, I decided to put it online after I discovered some of the original content previously and publicly available, had disappeared approximately early to mid 2019. At the same time, I present the content in an easily accessible theme-agnostic way.

The information provided by Raymond's blog is, for all practical purposes, more authoritative on Windows Development than Microsoft's own MSDN documentation and should be considered supplemental reading to that documentation. The wealth of missing details provided by this blog that Microsoft could not or did not document about Windows over the years is vital enough, many would agree an online "backup" of these details is a necessary endeavor. Specifics include:

<-- Back to Old New Thing Archive Index