title: Nested DO in FOR Loop in MS-DOS/Windows Batch
body: <p>I am trying to include multiple actions for each iteration of a FOR loop using nested DO statements. In essence, the intent is to combine both of the below lines into one.</p>
  
  <pre><code>FOR /F "delims=" %%a IN (ArchiveList.txt) DO IF NOT EXIST "%destfolder%\%%~nxa" ECHO "%%~nxa does not exist"
  FOR /F "delims=" %%a IN (ArchiveList.txt) DO IF NOT EXIST "%destfolder%\%%~nxa" set /a i = i + 1
  </code></pre>
  
  <p>I tried using parentheses, as shown below...</p>
  
  <pre><code>FOR /F "delims=" %%a IN (ArchiveList.txt) DO (IF NOT EXIST "%destfolder%\%%~nxa" DO(ECHO "%%~nxa does not exist" &amp; set /a i = i + 1))
  </code></pre>
  
  <p>...but this results in the below error appearing for every iteration:</p>
  
  <blockquote>
    <p>'DO' is not recongized as an internal or external command, operable
    program or batch file.</p>
  </blockquote>
  
  <p>Appreciate any help you can offer :)</p>