I am working on some batch script with following code block:
echo off echo SETTING UP ANT FOR THE BUILD .... set ANT_HOME=%~dp0%build\apache-ant-1.8.2 set ANT_BIN=%~dp0%build\apache-ant-1.8.2\bin SET path=%path%;%ANT_BIN%;%ANT_BIN%; echo PATH: %path% echo ANT_HOME: %ANT_HOME% echo ANT_BIN: %ANT_BIN% echo ANT GOT INSTALLED .... It help me to set up my path to my ant path in environment variable.
Now, each time i run this bat file it goes for setting up the environment variable for ant.
I have to put some condition that if path is already there then just skip the setup option else setup option begins.
How can we do this using bat script? As i am new to bat script i tried with following code block:
IF "%ANT_HOME%" == "" GOTO NOPATH :YESPATH ...
:NOPATH ...
but the problem here is i am not able to get how to check the case for following: The %ANT_HOME% is not blank but have some invalid ant directory path.
Can anyone help me out here ?