& :: comment
color C & :: set red font color
echo IMPORTANT INFORMATION
color & :: reset the color to default
Explanation:
&
separates two commands, so in this case color C
is the first command and :: set red font color
is the second one.
This statement with comment looks intuitively correct:
goto error1 :: handling the error
but it is not a valid use of the comment. It works only because goto
ignores all arguments past the first one. The proof is easy, this goto
will not fail either:
goto error1 handling the error
But similar attempt
color 17 :: grey on blue
fails executing the command due to 4 arguments unknown to the color
command: ::
, grey
, on
, blue
.
It will only work as:
color 17 & :: grey on blue
So the ampersand is inevitable.