vendredi 20 mars 2015

how to use IF EXISTS and ELSE in a batch file?

I am having some trouble running a batch file with an IF ELSE


I have a usb modem I am trying to launch on several computers with the same script, the issue is some are 32 bit systems and some are 64, I am trying to detect the system type and run the correct start command. Is this the best way to go about this? or is there possibly another way?


so far this is what I have



IF EXIST "C:\Program Files (x86)\" (goto USE64) ELSE (goto USE32)
:USE32

START "title" /d "C:\Program Files\MeditelInternet\" MeditelInternet.exe
goto :eof

:USE64

START "title" /d "C:\Program Files (x86)\MeditelInternet\" MeditelInternet.exe


When I run the start command by itself, the modem boots up with no problem, but this if else is not working for me :(


Aucun commentaire:

Enregistrer un commentaire