title: Windows batch script to delete everything in a folder except one
body: <p>I  have a script to delete all subfolders and files in a folder:</p>
  
  <pre><code>FOR /D %%i IN ("D:\myfolder\*") DO RD /S /Q "%%i" &amp; DEL /Q "D:\myfolder\*.*"
  </code></pre>
  
  <p>And it works great!
  Only problem is that I would like to exclude one or more folders, like the XCOPY exclude feature.</p>
  
  <p>I just cant figure how I could add that to the script.</p>