Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi all.
I have a question concerning a .bat file i created to launch a programm on a .pdf file on a CD.
The idea is the following:
1. The batchfile checkes the existance of an "adobe" folder on a computers HD.
1.1 If the folder doesn't exist, it should launch the "setup.exe" on the CD (which is the acrobat-setupfile)
1.2 If it does exist, it should launch the welcome.pdf file on the CD.What i have so far is:
- autorun.inf to launch the .bat file on CD
- both setup.exe and welcome.pdf in the root of the CDWhat i wrote in the batchfile is the following (i'm new at this so...don't laugh)
@ECHO OFF
@ECHO Checking the existance of Acrobat @ECHO Reader on your system
@ECHO OFFIF EXIST C:\program~1\Adobe\NUL Goto Start2
IF NOT EXIST C:\program~1\Adobe\NUL Goto Start1
:Start1
START\Start32.exe
Goto End:Start2
START2\Welcome.pdf
Goto End:End
Now the C:\program~1\... should become some sort of variable that searches the whole drive for the "adobe" folder (but i don't know how to do that actually)
So the .bat doesn't do anything now when i insert the CD. it doesnt' launch the "start32.exe" OR the "welcome.pdf"
Any idea's on how i can fix this are more then welcome heh.
Tnx in advance

OK
lets try this
============================================
@echo offrem check for existance of Adobe program
if exist C:\progra~1\adobe\adobe.exe goto inst_okrem run setup
\setup.exe
echo Wait until setup is completed
pause:inst_ok
rem run adobe with the pdf
C:\progra~1\adobe\adobe.exe \welcome.pdf
=============================================now, this is assuming the adobe is always installed in C:\progra~1\adobe\adobe.exe, which may not be the case
searching for it, all across c:\progra~1, is just a little more difficult
try this, it may not be perfect, but its the correct way, I guess
btw: what is the start32.exe ?

I think I have a better approach to this matter: checking if the .PDF files are already a recognized file type by the running system.
This will do it:
===== BATCH SCRIPT BEGIN =====
@echo offtype nul> %temp%.\T1.DAT
REGEDIT /E %temp%.\T1.DAT HKEY_CLASSES_ROOT\.PDF
FIND "\" < %temp%.\T1.DAT > nul
if not errorlevel=1 goto adobeOKstart /w \start.exe
:adobeOK
del %temp%.\T1.DAT
welcome.pdf
===== BATCH SCRIPT END =====Though the detection for the .PDF file type works for both Win9x/WinXP, just entering the name of the .PDF file on Win9x won't open it with the proper program (just on WinXP). I won't cover that other matter, since Frusti didn't mention the script should work on multiple OS's.
-- Leonardo Pignataro - Secret_Doom --
secret_doom@hotmail.com
www.batch.hpg.com.br______________________________________________________

Secret_doom & Miskva,
I wanna thank you both for your effords to my question. Even though i knew my solution was veeery simplified, i had no idea the batch-file would be that complex (to my opinion).
In other words, without your supports i don't think i would have been able to get it together.I tried the solution of secret_doom and it works perfect.
Even though the batch-file should be able to perform on different OS-systems, i tried it on XP & NT and in both cases he launches the welcome.pdf. Now i haven't tried on a comp yet that hasn't got acrobat installed yet, so that i still have to test.To answer the question of Miskva: the start32.exe = the setup-file of acrobat (that should autorun if the programm would not be located on the comps HD).
If it wouldn't work on other OS's then the ones i tried, or if the start32.exe wouldn't launch on comps where acrobat aint installed in yet, i'll try to locate the problem first myself before contacting you (even though i aint such a .bat-wizard like you guys hehe).
So again, thanks for your help, cause i owe this all to you guys.
delighed greetz,
Frusti

Hi all.
I'm currently succesfully running the .bat file as suggested by Secret_Doom on WinXP.
So as you said, the .pdf-file doesn't launch on other OS's. Is there any way in which you can make it compatible with Win 9x and WinNT for that matter?I've been searching on several scripting pages myself but i'm afraid that it's a little to complicated for beginner like me.
Sorry for bothering you guys about this again, but thanks in advance for taking my question into consideration.
Greetings,
Frusti

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |