Count files of particular type using batch

Closed
johnsw - Dec 4, 2009 at 12:06 AM
 Hawk - Dec 18, 2009 at 07:35 AM
Hello,

Does anyone know how to write a batch file that counts the number of xml files I have in the current directory?

Thanks in advance!

1 reply

Script for your question,

----------------
set /a count=0
for /f "tokens=* delims= " %%a in ('dir/s/b/a-d "path of the folder\*.xml"') do (
set /a count+=1
)

echo %count%
---------------------
variable "count" will give u the count...

-Pradeep
11