Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

windows - Opening multiple PDF documents using batch file

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

ECHO OFF
CLS
cd Program FilesAdobeReader 9.0Reader
Acrord32.exe C:UsersBW1.pdf
Acrord32.exe C:UsersBW2.pdf
Acrord32.exe C:UsersBW3.pdf
Acrord32.exe C:UsersBW4.pdf
Acrord32.exe C:UsersBW5.pdf
Acrord32.exe C:UsersBW6.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)

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

2.1m questions

2.1m answers

60 comments

57.0k users

...