CMD batch print pdf through Acrobat Reader DC

batch-filecommand-linepdf

I wish to print multiple PDF files in an alphabetical order,
these files are the lecture notes from MitOpenCourse 😀
but "right click – print" option only seems to print them out in a random order.

So I tried to use a commandline using the following reference:
http://partners.adobe.com/public/developer/en/acrobat/sdk/pdf/intro_to_sdk/DeveloperFAQ.pdf
(Page 27)

for %%X in (*.pdf) do "C:\Program Files\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe" /t %%X "\E06-02-4321\HP Officejet 7110 series"

So this is what I wrote in the batch file. But it does not seem to work.
When I run the batch all it does is it opens up a acrobat reader and that's it.
The printer I am using – as you can see is HP Officejet 7110 and E06-02-4321 is my computer name.

I tried using echo and pause in the batch but it does not show any errors.

Help would be appreciated!
Chris

Best Solution

AcroRd32.exe /t path "printername" "drivername" "portname"

Initiates Adobe Reader and prints a file, whose path must be fully specified, while suppressing the Print dialog box. The four parameters of the /t option evaluate to path, printername, drivername, and portname (all strings).

  • printername — The name of your printer.
  • drivername — Your printer driver’s name, as it appears in your printer’s properties.
  • portname — The printer’s port. portname cannot contain any "/" characters; if it does, output is routed to the default port for that printer.

IMHO the four parameters of the /t option are obligatory (not facultative) ones; hence, supply them as follows:

set "acrobat=C:\Program Files\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe"
set "printername=HP Officejet 7110 series"
set "drivername=HP Officejet 7110 series"
set "portname=USB001"
for %%X in (*.pdf) do "%acrobat%" /t "%%~fX" "%printername%" "%drivername%" "%portname%"
rem                                   %%~fX = fully qualified file name

Get actual values from wmic path Win32_Printer get caption, drivername, portname command or even from wmic path Win32_Printer get /value (scriptable using two nested for /F loops against wmic output).