title: Delete all files of specific type (extension) recursively down a directory using a batch file
body: <p>I need to delete all .jpg and .txt files (for example) in dir1 and dir2. </p>
  
  <p>What I tried was:</p>
  
  <pre><code>@echo off
  FOR %%p IN (C:\testFolder D:\testFolder) DO FOR %%t IN (*.jpg *.txt) DO del /s %%p\%%t
  </code></pre>
  
  <p>In some directories it worked; in others it didn't. </p>
  
  <p>For example, this didn't do anything:</p>
  
  <pre><code>@echo off
  FOR %%p IN (C:\Users\vexe\Pictures\sample) DO FOR %%t IN (*.jpg) DO del /s %%p\%%t
  </code></pre>
  
  <p>What I'm I missing in the second snippet? Why didn't it work? </p>