How can I load an image directly into the Windows clipboard from the command line?

Posted by Daniel J. Pritchett on Super User See other posts from Super User or by Daniel J. Pritchett
Published on 2011-02-28T14:58:47Z Indexed on 2011/02/28 15:27 UTC
Read the original article Hit count: 290

Filed under:
|
|
|

My dad asked me how he could script the pasting/inclusion of images in various applications. I'm sure I could script out some quick <img src=... HTML but I believe he's also looking to do this in Windows GUI applications like Word or Outlook.

So, how could I script a process with the following inputs and outputs:

  1. load_image_into_clipboard_script.cmd sample_file.jpg
  2. Clipboard now contains the aforementioned image file, just as if I'd e.g. opened it in Paint and done a Select All -> Copy.

I noticed there's a clip.exe utility with Vista/Win2003 and up; perhaps that will be a useful intermediary?

© Super User or respective owner

Related posts about Windows

Related posts about command-line