I've noticed that sometimes when I put comments in my batch script, i get the error:
The syntax of the command is incorrect.
Other times, theres no issue. I see no pattern in the cases it works vs the cases it doesn't.
For example:
for /R /D %%d in (.\*) do (
echo %%d
:: comment here <<NO ERROR>>
for %%f in (%%d\*) do (
echo %%f
:: comment here <<ERROR>>
)
)
The top comment causes no problem, the bottom one does. Both are on their own line, exact same text, tabbed, and directly after an echo statement. No problem with the first comment, second causes errors.
why?