The problem is using note tags (: :).
:: can only be used safely for notes outside blocks. Inside the blocks, he will try to execute the next line, since he assumes that a command follows the label.
An empty line after a note mark causes an error.
, . , echo - .
:
SET foo=bar
:: test
IF "%foo%" EQU "bar" (
:: foo
ECHO "equal to"
) ELSE (
:: bar
ECHO "not equal to"
)
:
SET foo=bar
rem test
IF "%foo%" EQU "bar" (
rem foo
ECHO "equal to"
) ELSE (
rem bar
ECHO "not equal to"
)
http://ss64.com/nt/rem.html