title: CD command not working inside FOR loop?
body: <p>I am new to batch programming.</p>
  
  <p>The output of the following program:</p>
  
  <pre><code>@ECHO OFF
  cd /d C:%HOMEPATH%\AppData\Roaming\Mozilla\Firefox\Profiles
  echo %cd%
  FOR /F %%i IN (temp_list.txt) DO (
   echo i is %%i
   cd folder
   echo %cd%
  )
  cd folder
  echo %cd%
  pause
  </code></pre>
  
  <p>is:
  <br></p>
  
  <pre><code>C:\Users\arnab\AppData\Roaming\Mozilla\Firefox\Profiles
  i is e6slask2.default
  C:\Users\arnab\AppData\Roaming\Mozilla\Firefox\Profiles
  i is random.default
  The system cannot find the path specified.
  C:\Users\arnab\AppData\Roaming\Mozilla\Firefox\Profiles
  The system cannot find the path specified.
  C:\Users\arnab\AppData\Roaming\Mozilla\Firefox\Profiles\folder
  Press any key to continue . . .
  </code></pre>
  
  <p>I understand that the <code>FOR</code> logic is wrong (i effectively am doing <code>cd folder</code> twice, should be possible only unless there is a 'folder' inside a 'folder')
  <br>
  but why isn't the cd folder taking me to the <code>"C:\Users\abhagaba.ORADEV\AppData\Roaming\Mozilla\Firefox\Profiles\folder"</code> for the first iteration in the <code>FOR</code> loop?</p>
  
  <p>Does <code>CD</code> not work inside a <code>FOR</code> loop?</p>