9

My question is essentially the reverse of this. I am looking for a Windows utility that can copy a set of files to the clipboard, given their paths as command-line arguments. It should copy the actual files and not their contents (such that they can be pasted normally in Windows Explorer, for example.)

Must be compatible with Win7.

Free and/or open source would be ideal.

Thanks!

7
  • There’s no build-in way, and I have yet to find a third-party tool because the clipboard method uses Explorer to perform file operations and the command-prompt is a separate thing with no direct access (in fact, there isn’t even an API function that can be used to directly do it). Sorry. As a work-around, you could use start. to open an Explorer window to the current directory to make it a little quicker to copy in the normal way.
    – Synetech
    Dec 1, 2013 at 6:02
  • 1
    You could probably do this with AutoHotkey which gives you direct access to the clipboard and scripts can be made into self-contained .exe files.
    – martineau
    Dec 1, 2013 at 6:08
  • It seems possible with PowerShell. See here (not tried). Dec 1, 2013 at 7:20
  • @martineau problem isn't with access to clipboard, which can be done with many tools in numerious ways. Problem is with putting file links to clipboard the way Explorer can paste it (when there's just filenames in text format, it doesn't). Dec 1, 2013 at 7:30
  • @martineau Also note, there's some utilities allowing to copy something in them, and then paste to Explorer. But AFAIK they either use shell components to display files (like Total Commander), or use shell extensions to catch when user pastes a file and finish work on their own. Dec 1, 2013 at 7:52

1 Answer 1

1

Pending a better answer, here are two approaches I am aware of so far:

http://blogs.msdn.com/b/oldnewthing/archive/2013/05/20/10419965.aspx

https://stackoverflow.com/questions/17189010/how-to-copy-cut-file-not-contents-to-clipboard-in-windows-with-command-line/17354470

The first was suggested by @LogicDaemon in a comment above, which my lack of rep doesn't allow me to upvote.

Unfortunately both of these are not pre-precompiled utilities - just some source code that could be used in making such a utility.

Not the answer you're looking for? Browse other questions tagged .