title: Redirect output of command in for loop of batch script
body: <pre><code>...
  for /F %%F in ('dir /B %* 2&gt; nul') do (
  ...
  </code></pre>
  
  <p>What I'm attempting to do here is discard the err output of the command (and loop over the stdout output). However, it complains:</p>
  
  <pre><code>2&gt; was unexpected at this time.
  </code></pre>
  
  <p>Is this some way to achieve this?</p>