title: Using batch to count the number of specific files in folder
body: <p>I have a bunch of files in a folder that their names are like a1.txt, a6.txt, a8.txt,..and I need to count  them I tried this batch file but it does not recognize * as a way to account for all numbers and does not return the correct answer.</p>
  
  <pre><code>set /a count=0
  for /F "tokens=* delims= " %%i in ('dir/s/b/a-d "C:\Users\xyz\desktop\Project\a.*"') do (set /a count=count+1) 
  </code></pre>
  
  <p>Can you see what I am doing wrong? Thanks for your help in advance.</p>