1.

Solve : Using if statement in batch file?

Answer»

Hi!
I need to add if statement in my batch file so that it checks for the file first. if it exists then it should LAUNCH it if it does not exists then it should launch another application.

How would I go about writing the code for this? The following represents what i want but don't know how to do this in the batch file

if (check for the A.txt)
{
launch A.txt
}
else
{
launch B.txt
}

Any help would do it.
PLEASE REPLY ASAPI FIGURED it out.

Sorry for the trouble
Hi, I need to do the same thing how did you do it?IF NOT EXIST A.txt GOTO LAUNCH B
launch A.txt
GOTO END

:LAUNCH B
launch B.txt
GOTO END

:END
echo FINISHED.



Discussion

No Comment Found