title: How to get accurate file count using batch (windows xp)?
body: <p>Trolled through similar questions and am stuck on my script.</p>
  
  <p>Basically, I need this .bat to check the directory for the number of files with the Lockbox prefix, store the count to a variable, and eventually call an .exe to import each of the files.</p>
  
  <p>Here is what I have so far. My problem is that the test directory has a total of 12 txt files, but I only need the ones with the Lockbox prefix (11 of them):</p>
  
  <pre><code>@echo off
  
  set count=0
  
  for %%a in ('dir /a-d /a-h /a-s "\\ip_of_server\Directory\LockBox*.txt"') do set /a count+=1
  
  @echo File count = %count%
  pause
  </code></pre>