title: Batch-Script: Search subfolders, find file, delete all else
body: <p>I've been trying to figure this out for some time now, and I have been searching the web immensely, but I couldn't find the right answer just yet. 
  So here's my problem:</p>
  
  <p>I want to create a batch file, that searches through all subfolders of a certain directory, finds a specific file and then deletes everything but that file in the folder that the searched file was in. </p>
  
  <p>What I came up with so far is this:</p>
  
  <pre><code>cmd /k for /f %%a IN ('dir /b /s Neuer') do if not [%%a] == [index.txt] del /q %%a
  </code></pre>
  
  <p>But that deletes just every file in every subfolder - not quite what I want. </p>
  
  <p>Can anyone help?</p>