0

I have a problem with the script below:

set "acrobat=C:\Program Files (x86)\Adobe\Acrobat Reader DC\Reader\AcroRd32.exe"
set "printername=\\MINPRT\MNCE"
set "drivername=Canon iR1730/1740/1750 PCL6"
set "portname=192.168.40.60"
for %%X in (\\Minfls\Messinter\LIBRI\Prenotazioni\SUPERIORI\*.pdf) do ("%acrobat%" /t "%%X" "%printername%" "%drivername%" "%portname%")

The script start and open Acrobat Reader DC but, since I don't close the Acrobat's Windows, the print doesn't start. What can I do to solve this problem?

TylerH
  • 20,799
  • 66
  • 75
  • 101
  • What happens with using in body of __FOR__ loop the command `start "" /wait /min "%acrobat%" /s /t "%%X" "%printername%" "%drivername%" "%portname%"`? – Mofi Mar 03 '16 at 17:34
  • The job starts, print the PDF but never end, I have to close the "Acrobat Windows" to let the job ends... – Roberto Ugolini Mar 07 '16 at 08:15
  • I entered in a WWW search engine `adobe reader close after print` and found dozens of pages. Do the same and read them to find a solution for Adobe Reader not closing/exiting itself after printing the PDF file. – Mofi Mar 08 '16 at 06:44
  • Thank you, I saw... but nothing that works for me. It seems like Acrobat doesn't return the control to the batch file, so the only way to make the batch finish is.... close the window (I tried with "Taskkill" but the batch is "stopped" at the START statement (with the call to Adobe...) – Roberto Ugolini Mar 08 '16 at 10:27
  • My suggestion is using a different PDF Reader which can be called from within a batch file for printing a PDF and automatically exiting after printing, see for example [Batch print pdf through commandline with sumatra pdf](http://stackoverflow.com/questions/25936650/). With Adobe Reader you can't use `/wait` as Reader never exits, must wait X seconds in batch processing and then use taskkill. But this is no good solution as you don't really know how long to wait before terminating Adobe Reader by batch job. – Mofi Mar 08 '16 at 16:15
  • 1
    It seems that with sumatra PDF the job works. Thanks a lot for the support.. – Roberto Ugolini Mar 09 '16 at 15:16

0 Answers0