title: How to redirect a FOR command in Windows batch
body: <p>I know how to redirect a Windows shell command with the <code>&gt;|&gt;&gt;|&lt;|&lt;&lt;</code> operators, but I cannot accomplish it for commands used inside a <code>FOR</code> command?</p>
  
  <p>For instance:</p>
  
  <pre><code>for /f "usebackq tokens=*" %%I in (`__COMMAND__ 2&gt;nul`) do (
      set MYVAR=%%I
  )
  </code></pre>
  
  <p>You see, here I would like to silent the stderr of this <code>__COMMAND__</code>.
  The shell complaints that it does not expect a <code>2</code> in that place (same behaviour for other redirections).</p>
  
  <p>Anybody can help here?</p>