Count files with .bat file

...
June 26, 2006 at 16:38:17
Specs: XP SP2, 3.2 ghz
I'm trying to use a bat file to count the number of files in a folder.
I tried:
dir /a /s "C:\folder" |find /c /v ""
but for some reason it doesnt report the total accurately (12 too many).
I also tried:
dir "C:\folder" |find /v ""
it reports the right number of files, but it also lists too much crap. I just want a single number in my dos prompt.

Ideas anyone?


See More: Count files with .bat file

Report •


#1
June 26, 2006 at 17:35:54
I just found this somewhere and it is accurate:

dir "C:\folder" /b/s |find /v /c "::"

so never mind ;-)


Report •

#2
June 26, 2006 at 18:33:00
If you want ONLY FILES add /a-d


=====================================
If at first you don't succeed, you're about average.

M2



Report •

Related Solutions


Ask Question