Batch / CMD script to delete folder but excluding more than one
<p>In advance: I'm new to batch or programming in general so please explain as much as possible.   </p>

<p>My problem:<br>
I want to delete all folders <strong>not</strong> named <em>X</em> and <em>Y</em> in a directory Z (ex. D:\Test\z)</p>

<p>So let's say Z contains these folder:  </p>

<ul>
<li>backup</li>
<li>resources</li>
<li>project1</li>
<li>project2</li>
<li>project3</li>
</ul>

<p>I'd need to exclude only <em>backup</em> and <em>resources</em> from deletion via a script.<br>
I looked up multiple soultions for not deleting only <strong>one</strong> folder with a certain name but I don't know if it's possible for multiple values with Batch.</p>