title: Batch Script Search & Delete all folders that match name "*Cache*" but leave out certain paths from traversal
body: <p>As I asked in Q-title, how can I traverse the whole <code>%SYSTEMDRIVE%</code> root folder for any directory that contains <code>*Cache*</code> in it's name and fully purge that directory inside-out but leave out certain paths from such traverse-delete, such as <code>%APPDATA%\npm</code> ?</p>
  <p>I have the following command for traversing and deleting all folders containing <code>Cache</code>(case-insensitive) in their name and delete those completely:</p>
  <pre><code>pushd &quot;%SYSTEMDRIVE%&quot;
  for /d /r %%a in (&quot;*Cache*&quot;) do if exist &quot;%%a&quot; ( echo &quot;%%a&quot; &amp; rd /s /q &quot;%%a&quot; )
  popd
  </code></pre>
  <p>But I want to skip looking into <code>%APPDATA%\npm</code> completely, how can I achieve that ?</p>
  <p><strong>Note:</strong> OS: Windows 10 64Bit</p>