title: Windows batch looping through subfolders and running a command
body: <p>I'm trying to have a nested for loop in windows command prompt where I go to each subfolder in a specified folder to concatenate all the text files in there into one text file. I'm trying to use </p>
  
  <pre><code>FOR /F  IN (.) DO (for %f in (*.dat) do type “%f” &gt;&gt; aggregate.txt)
  </code></pre>
  
  <p>but its not working. Someone help me!</p>