Skip to content

Instantly share code, notes, and snippets.

@kylexlau
Created March 4, 2011 07:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kylexlau/854287 to your computer and use it in GitHub Desktop.
Save kylexlau/854287 to your computer and use it in GitHub Desktop.
count how many files in a directory at windows
:top
@Echo off&title wkdxz @ BAT-GO At:2010-09-19 12:23:59
echo 统计中......
set cdir=D:\E3SDC\send\data\M10
for /f "delims=" %%a in ('dir /s/b/a-d %cdir%') do set/a a+=1
for /f "delims=" %%a in ('dir /s/b/ad %cdir%') do set/a b+=1
cls&set /p=【%cdir%】文件夹内有 %b% 个文件夹, %a% 个文件,<nul
set a=0
set b=0
timeout /T 3 /NOBREAK
goto top
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment