I think an error occurs on this line:
IF %message%==exit GOTO :exit
If %message% contains a space, for example. hh , this line extends to
IF hh==exit GOTO :exit
which is not a valid syntax for an IF .
To avoid errors, enclose the operands in quotation marks:
IF "%message%"=="exit" GOTO :exit
But keep in mind that this option is also unreliable and will cause a syntax error if %message% contains a quotation mark. "
And by the way, you can compare case insensitive strings with the /i switch:
IF /i "%message%" EQU "exit" GOTO :exit
Helen source share