I have:
@echo off echo before IF 1 == 1 ( echo got it ) ELSE ( echo missed } echo done
This code just prints "earlier" and nothing else. I have no idea what I'm missing ...
You have the wrong type of bracket at the end of your ELSE - you have }instead ). Change it to:
}
)
@echo off echo before IF 1 == 1 ( echo got it ) ELSE ( echo missed ) echo done
conclusion:
before got it done
it works as if in a nested style
IF %CHUSEL%==0 ( SET IP=10.148.24.1 ) ELSE ( IF %CHUSEL%==1 ( SET IP=10.148.24.2 ) ELSE ( IF %CHUSEL%==2 ( SET IP=10.148.24.3 ) ELSE ( IF %CHUSEL%==3 ( SET IP=10.148.24.4 ) ) ) )