title: Read file in a nested FOR loop in batch
body: <p>I'm trying to access a file and read its content in a nested loop but the inner loop cannot access the file.. (in batch)</p>
  
  <p>Here's the code (a small part of the entire script):</p>
  
  <pre><code>for %%b in (!directory!) do (
     echo File used: %%b
     for /f "delims= " %%c in (%%b) do (
        echo %%c
     )
  )
  </code></pre>
  
  <p>The problem is: </p>
  
  <p>if "%%b" equals "C:\Documents and settings\test\test.txt", the inner loop will try to access to "C:\Documents" (because of the space). If I put double-quotes around "%%b", it will parse it as a string and not the file itself.</p>
  
  <p>How can I deal with that? The file is dynamic, I don't know its name...</p>
  
  <p>Thanks</p>