title: windows bat file cannot comment out this
body: <p>I am trying to comment out some useful hints. I followed this Stack Overflow page to apply the most defensive comment - using double quotes. <a href="https://stackoverflow.com/questions/63491984/rem-comment-in-bat-file-causes-error-25-was-unexpected-at-this-time">Comment error</a>. But I still get error</p>
  <p>This is my simple script: test_comment.cmd</p>
  <pre><code>@echo off
  
  :: &quot;   %~nI        - expands %I to a file name only &quot;
  :: &quot;   %~xI        - expands %I to a file extension only &quot;
  for /F &quot;delims=&quot; %i in (&quot;c:\foo\bar baz.txt&quot;) do @echo %~nxi
  </code></pre>
  <p>This is the error I got when I run it</p>
  <pre><code>&gt;test_comment
  The following usage of the path operator in batch-parameter
  substitution is invalid: %~nI        - expands %I to a file name only &quot;
  
  
  For valid formats type CALL /? or FOR /?
  The syntax of the command is incorrect.
  </code></pre>
  <p>If I removed those two commented lines, error would disappear; so that I know the comment didn't work.</p>
  <p>How should I comment out those two lines?</p>
  <p>I really don't want to delete them.</p>
  <p>I am using windows 10, latest patch, default cmd.exe.</p>