title: How do I execute code on most directories except those listed in a file with a batch file?
body: <p>So I am trying to execute code on most directories under another except for those that I list in a text file.  So for example, if I wanted to run the code on all directories directly in C:\ but not say C:\avoidme\ I would add C:\avoidme as a line in exclusions.txt. But the code I have below does not seem to be working.  Any ideas on how this could be done? </p>
  
  <pre><code>for /f %%d in ('dir /b C:\') do (
   find /c "C:\%%d" exclusions.txt 
   if %errorlevel% equ 1 (
    Do code here
  
  )
  </code></pre>