I have:
@echo off
echo before
IF 1 == 1 (
echo got it
) ELSE (
echo missed
}
echo done
This code just prints "before" and nothing else. I have no idea what I'm missing...
You've got the wrong kind of bracket at the end of your ELSE - you've got }
instead of )
. Changing it to:
@echo off
echo before
IF 1 == 1 (
echo got it
) ELSE (
echo missed
)
echo done
the output is:
before
got it
done
this works just like if else in 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
)
)
)
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With