title: Execute batch file when a new file is added to a folder
body: <p>I am using the batch file example below that I got from <a href="https://stackoverflow.com/questions/4230976/batch-file-to-monitor-additions-to-download-folder">batch file to monitor additions to download folder</a>. I would like to modify this so that it loops through all the subfolders.</p>
  
  <p>Anyone have any ideas on how to do this?</p>
  
  <pre><code>@echo off
  if not exist c:\OldDir.txt echo. &gt; c:\OldDir.txt
  dir /b "d:\My Folder" &gt; c:\NewDir.txt
  set equal=no
  fc c:\OldDir.txt c:\NewDir.txt | find /i "no differences" &gt; nul &amp;&amp; set equal=yes
  copy /y c:\Newdir.txt c:\OldDir.txt &gt; nul
  if %equal%==yes goto :eof
  rem Your batch file lines go here
  </code></pre>