Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 3 down vote accepted

To copy an image into the clipboard, use in the script the tool NirCmd with the copyimage action :

nircmd.exe clipboard copyimage "image-file"

However, to cause any application whatsoever to paste the clipboard image is much harder.

share|improve this answer
    
Excellent, thank you! – Daniel J. Pritchett Feb 28 '11 at 15:33
    
I set up a quick two-step copy and notification process and then hid it behind a Windows shortcut I can invoke with ctrl-shift-alt-S: nircmd.exe clipboard copyimage "filename.JPG" msg dpritchett Signature loaded into clipboard! – Daniel J. Pritchett Feb 28 '11 at 15:51
    
When I do this with png I get a black background instead of transparent. Any solutions? – Mark Nov 21 '15 at 21:51
    
@Mark: Get in touch with NirSoft. – harrymc Nov 22 '15 at 6:15

You must log in to answer this question.

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