Opening pdf with .bat file

Hi all,

I was reading this thread:
because I want to do the same - launch a pdf from a button. The problem is that I will end up launching 47 pdfs from 47 buttons (one per, obviously). What I want to know is, do I need a .bat file for every single .pdf file? or is there some way to consolidate?

Question #2 - if I DO need a .bat for each .pdf then do they all have to be at the same level as my main swf? Or can I tuck them into a subdirectory?

Any guidance would be greatly appreciated!

fscommand is a pain

it never does what i claims to do, and they keep changing what it is allowed to do.

I checked it out though.

You should have your projecter file (.exe, cant be a .swf) in some folder, and in that folder, you need another folder called fscommand (must be named this for security reasons)
In that folder you need to have your bat files. The pdfs can be anywhere as long as you give a correct path to them in the bat file. In dos you SHOULD be able to type

openpdf.bat filename.pdf

where openpdf.bat contains

start %1

but fscommand will not accept

fscommand(“exec”,“openpdf.bat filname.pdf”);

because the second string must not contain spaces

soooo… you either need to have a bat for each pdf, or do some sneaky things with bat files.

for example, if your pdf’s are in a certain order, you can have a bat file called next.bat and a bat file called last.bat, and a bat file call openpdf.bat, and write some actionscript to call fscommand multiple times to switch to the file you want, and then call openpdf.bat.

This unfortunately requires that you leave a small temporary file somewhere on the users computer (assuming you are running from a readonly CDROM)

but it can be done…