views:

1991

answers:

5

Hello,

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)

Thank you for any help Dmitri

+3  A: 

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).

A list of other available batch commands.

Assaf Lavie
In that case you can probably use start alone on the PDF files as well. Depending on the default application for them, though :)
Joey
A: 

Have you tried whether Acrobat Reader allows for more files on the commandline, ie.

start acrord32.exe 1.pdf 2.pdf 3.pdf
jachymko
A: 

Thank you!

Using start did the trick. I had to use start as many times as the number of pdf documents I want to open. For some reason

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

opens only the first document. So I guess Acrobat reader might not allow for more files on the command line.

I rally appreciate your answers.

A: 

Has anyone tried opening pdf file in browser or iframe. i need that and start or acrord32 opens in new window always. i want to open in the same window from where th ethe page having vbscript is run.

by the way, Acrord32.exe 1.pdf 2.pdf 3.pdf works; it opens multiple pdf files in different broswers.

Sam
A: 

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...)

pipitas