Opening multiple PDF documents using batch file

35,686

Solution 1

Use start:

start acrord32.exe 1.pdf
start acrord32.exe 2.pdf
start acrord32.exe 3.pdf

Or even (as Johannes Rössel suggests in the comment below):

start 1.pdf
start 2.pdf
start 3.pdf

Would probably work as well (depending on your default PDF viewer).

Note that when using start you have to be careful when using quoted arguments, as the following won't work (the first quoted argument is interpreted as the title for a new console window):

start "1.pdf"

Instead you'll have to do the following:

start "" "1.pdf"

It's an annoying quirk of start, but you have to effectively supply a dummy title in this case to properly open the specified file (even though the title is unnecessary as this won't create a new console window).

A list of other available batch commands.

Solution 2

For me it works even without the start command. I use:

c:\path\to\my.pdf

in cmd.exe windows frequently, and it always opens Acrobat Reader (my default viewer on Windows). In a batchfile I've written to generate PDF via Ghostscript, my last two lines are:

"%ouptutpath%\%outputfile%.pdf"
"%outputpath%\%outputfile%-optimized.pdf"

which automatically opens both generated PDFs in two different Reader windows. (My %outputpath% contains spaces, the %outputfile% may also have some...)

Share:
35,686
Admin
Author by

Admin

Updated on July 09, 2022

Comments

  • Admin
    Admin almost 2 years

    I am trying to open several PDF documents using a simple batch file:

    ECHO OFF
    CLS
    cd Program Files\Adobe\Reader 9.0\Reader
    Acrord32.exe C:\Users\BW1.pdf
    Acrord32.exe C:\Users\BW2.pdf
    Acrord32.exe C:\Users\BW3.pdf
    Acrord32.exe C:\Users\BW4.pdf
    Acrord32.exe C:\Users\BW5.pdf
    Acrord32.exe C:\Users\BW6.pdf
    EXIT
    

    The above batch file opens the first PDF only, then waits until I close it for the next PDF file to open. How can I have all the PDF documents open at the same time? (Like going to Acrobat Reader, file->Open->xx.pdf)

  • Rich
    Rich about 15 years
    In that case you can probably use start alone on the PDF files as well. Depending on the default application for them, though :)
  • Altimus Prime
    Altimus Prime about 3 years
    I get the error ("C:\Users\*.pdf") was unexpected at this time.
  • Moses
    Moses about 2 years
    I also got this error