3

I need to print a photo (.jpg) from the command line in Windows 7. I have tried using lpr to no success, and found methods for Windows XP like the following:

rundll32 shimgvw.dll ImageView_PrintTo /pt myPhoto.jpg "myPrinter"

This doesn't work (not surprising), and my hours of Googling has turned up nothing else. I'm trying to find a stock way to do this on any Windows 7 machine without needing to install or set anything up. Does there exist such a command?

nemophrost
  • 567
  • 1
  • 8
  • 11

3 Answers3

7

Maybe reformatting the command and adding some absolute paths would help? The following worked for me:

rundll32 C:\WINDOWS\system32\shimgvw.dll,ImageView_PrintTo "c:\mydir\my.bmp" "Fictional HP Printer"
loop
  • 825
  • 6
  • 15
5

Try via MS Paint

mspaint /pt <FILE> <PRINTER>

Works like a charme for me.

powerMicha
  • 2,753
  • 1
  • 24
  • 31
0

Did you look here?

http://social.technet.microsoft.com/Forums/en-US/ITCG/thread/87e942da-faec-48e1-b339-7ba3da7c9134

The provided rundll32 command line looks slightly different from yours. Alternatively, the page implies that mspaint.exe has a command-line option to print.

Note that I haven't tried any of these, though...

reuben
  • 3,360
  • 23
  • 28