I have a script with:
IF "%USER_COUNTRY%"=="ie" IF NOT "%POS_TYPE%" == "ipos" ( GOTO IE_Start)
and below I have some labels:
:PT_Start
ECHO Start PT
rem for PT Num Lock must be activated before POS start
.\native\klocks.exe +n
IF NOT EXIST c:\C3 GOTO NO_C3
pushd c:\C3\
tskill /V /A c3_net
cmd /c START /min c3_net.exe
GOTO C3_DONE
:NO_C3
ECHO C3 not present in C:\C3\
ECHO start without C3
:C3_DONE
popd
GOTO Start_Now
:IE_Start
ECHO Start IE
IF NOT EXIST c:\C3 GOTO NO_C3_RPM
pushd c:\C3\
tskill /V /A c3_rpm_net
cmd /c START c3_rpm_net.exe
GOTO RPM_C3_DONE
:NO_C3_RPM
ECHO C3 not present in C:\C3\
ECHO start without C3
:RPM_C3_DONE
popd
GOTO Start_Now
:PL_Start
ECHO Start PL
pushd c:\AModule\
cmd /c START Forcom.AModule.exe
echo "AModule ist gestartet"
popd
GOTO Start_Now
I am getting:
The system cannot find the batch label specified - IE_Start
Script is run under Windows but it was saved on Unix so it has LF line-end signs. I am telling this because there are few ways to fix that problem but I don't understand why. I noticed that following fixes the problem:
- Changing line-end signs to CR+LF (Windows-specific);
- Moving
IE_Start
label and its part of code beforePT_Start
; - Removing
/min
fromcmd /c START /min c3_net.exe
; - Changing line from point 3) to
cmd /c START /min C:\C3\c3_net.exe
(this file doesn't exist anyway);
What's going on?