title: How to delete multiple files from multiple folders in batch
body: <p>I was trying to make a batch file that could copy a whole folder (with files and subfolders) inside multiple subfolders placed inside multiple subfolders.
  The fact is that I messed up the commands and ended with all the files and subfolders copied where I wanted but not inside a folder.</p>
  
  <p>Now I want to delete all these files and subfolders without deleting the original files from each folder.</p>
  
  <p>I tried this command directly in a command prompt window, but it didn't work and I have no idea why because the input and the loops appear to be right.</p>
  
  <pre><code>for /d %a in (`E:\Mis documentos\Nueva carpeta\Filosofia\*') do for /d %b in ("%a\*") do for %c in ("*") do del %b\%c
  </code></pre>
  
  <p>This returns "The system cannot find the specified file" but the command executed is <code>del E:\Mis documentos\Nueva carpeta\Filosofia\Some folder\Another folder\The exact file</code> that I want to delete in that folder. What could cause that?</p>
  
  <p>When I do the same but echoing %b/%c it returns the exact path of the items I want to delete from the folders. (Note that I am trying to run this command from inside the folder I wanted to copy in the first place so that I can recover the name of each file independently.)</p>