title: Exclude certain subfolders when scanning the contents of a folder
body: <p>I have a batch file that I'm using to scan the c:\ folders (and their respective subfolders) on a Windows 7 box using a for loop. I am having issues in excluding certain folders, such as Users, Windows, LocalAppData etc.</p>
  
  <p>I need to scan through folders in C:\ to find a specific named folder (i.e. "myFolder") without scanning through the above mentioned folders in order to increase the time taken to detect the desired folder within the C: folder.</p>
  
  <p>CODE:</p>
  
  <pre><code>@echo off
  
  for /d /r "c:\" %%a in (*) do (
      findstr /v "Users" "Windows"
  )
  </code></pre>