title: Unexpected "The system cannot find the drive specified." in batch file
body: <p>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):</p>
  
  <pre><code>@echo off
  
  if /i [%1]==[] (
      echo A
      ::
      ::
      echo B
  )
  </code></pre>
  
  <p>Putting this in a batch file and then running it with no parameters produces the following output:</p>
  
  <pre><code>A
  The system cannot find the drive specified.
  B
  </code></pre>
  
  <p>Deleting one of the <code>::</code> lines, or deleting the surrounding <code>if</code>, <em>fixes</em> things so you get the expected output:</p>
  
  <pre><code>A
  B
  </code></pre>
  
  <p>What's going on here? Why is it looking for a drive?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>Thanks for the responses for far. So my question really boils down to this:</p>
  
  <blockquote>
    <p>What are the rules for determining whether <code>::</code> means "start of comment" or "drive letter colon"?</p>
  </blockquote>
  
  <p>Perhaps it's easier to just switch back to <code>REM</code> for adding comments so there's no scope for ambiguity, but I do find the <code>::</code> style easier to read.</p>