title: How to set a variable inside a loop for /F
body: <p>I made this code</p>
  
  <pre><code>dir /B /S %RepToRead% &gt; %FileName%
  
  for /F "tokens=*" %%a in ('type %FileName%') do (
      set z=%%a
      echo %z%
      echo %%a
  )
  </code></pre>
  
  <p><code>echo %%a</code> is working fine but <code>echo %z%</code> returns "echo disabled".</p>
  
  <p>I need to set a %z% because I want to split the variable like <code>%z:~7%</code></p>
  
  <p>Any ideas?</p>