批处理命令 统计Windows目录下文件夹的个数和文件的个数? 显示格式为:“文件夹个数:文件数:”

2024-12-21 10:35:16
推荐回答(1个)
回答1:

@Echo off&title wkdxz @ BAT-GO At:2010-09-19 12:23:59
echo 统计中~~~
for /f "delims=" %%a in ('dir /s/b/a-d %windir%') do set/a a+=1
for /f "delims=" %%a in ('dir /s/b/ad %windir%') do set/a b+=1
cls&set /p=【%windir%】文件夹内有 %b% 个文件夹, %a% 个文件,