title: Command Line FOR /F Fails
body: <p>I have a DOS build script which works on one Windows Server 2008 R2 but not another. To see the symptoms on the broken machine entering either of the following at the command line: </p>
  
  <pre><code>for /f %X in ('dir /b *.txt') do @echo %X
  for /f "usebackq" %X in (`dir /b *.txt`) do @echo %X
  </code></pre>
  
  <p>gives: "'dir /b *.txt' is not recognised as an internal or external command." while e.g.</p>
  
  <pre><code>for %X in (*.txt) do @echo %X
  </code></pre>
  
  <p>works fine, so the /f is not being obeyed properly. I don't believe this is the Command Extensions themselves (starting cmd /x shows the same behaviour; running them inside cmd /y on the problem server gives the normal "/f was unexpected at this time"). I have also checked the command extensions registry keys and tried "setlocal enableextensions" in the batch files.</p>
  
  <p>I don't think it's relevant but differences between the servers are that the failing one is physical; its CPU doesn't have VT extensions; does have McAfee installed. As far as I know they were installed the same way though at different times.</p>
  
  <p>Does anyone have any suggestions? I am stuck!</p>