I've got a problem with a batch file (Windows 7 x64). I've managed to reduce it to the following (there are two empty comment lines; it doesn't seem to matter whether there's an actual comment):
@echo off
if /i [%1]==[] (
echo A
::
::
echo B
)
Putting this in a batch file and then running it with no parameters produces the following output:
A
The system cannot find the drive specified.
B
Deleting one of the ::
lines, or deleting the surrounding if
, fixes things so you get the expected output:
A
B
What's going on here? Why is it looking for a drive?
Edit
Thanks for the responses for far. So my question really boils down to this:
What are the rules for determining whether
::
means "start of comment" or "drive letter colon"?
Perhaps it's easier to just switch back to REM
for adding comments so there's no scope for ambiguity, but I do find the ::
style easier to read.