Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Help: Batch file to open all PDF files in a directory

1,047 views
Skip to first unread message

Ryan Cragg

unread,
Mar 16, 2004, 7:16:31 PM3/16/04
to
I've been trying to write a simple bat file that will open all PDF
files in a directory. What I have so far is:

@echo off

for %%I in (*.pdf) do "C:\Program Files\Adobe\Acrobat
6.0\Reader\AcroRd32.exe" %%~fI


This works well if Acrobat Reader is already running, but if it isn't
running, then the first file is opened, and then the batch process
stalls. If I close Acrobat, then the next file will be opened.

I'm guessing that Acrobat is taking to long to open, so the batch
process is waiting for something that never comes, but I don't really
know.

Anyone have any ideas as to how I can get all the files to open,
without having to remember to have Acrobat Reader already started
before I run the bat file?

Thanks,

Ryan Cragg

foxidrive

unread,
Mar 16, 2004, 7:23:46 PM3/16/04
to
On 16 Mar 2004 16:16:31 -0800, Ryan Cragg wrote:

> I've been trying to write a simple bat file that will open all PDF
> files in a directory. What I have so far is:
>
> @echo off
>
> for %%I in (*.pdf) do "C:\Program Files\Adobe\Acrobat 6.0\Reader\AcroRd32.exe" %%~fI
>
>
> This works well if Acrobat Reader is already running, but if it isn't
> running, then the first file is opened, and then the batch process
> stalls. If I close Acrobat, then the next file will be opened.

Try this

@echo off
for %%I in (*.pdf) do start "" "C:\Program Files\Adobe\Acrobat 6.0\Reader\AcroRd32.exe" %%~fI

Ryan Cragg

unread,
Mar 17, 2004, 12:38:23 PM3/17/04
to
foxidrive <foxi...@Shotmail.com> wrote in message news:<pe5xqqx3rjeo$.bpwj3tfh...@40tude.net>...

Thanks a million foxidrive! That got it working exactly like I wanted.

-Ryan Cragg

0 new messages