::好的办法没有想到,只有用这个办法了,你看看行不,此批处理和TEST文件夹在同一根目录下,而且TEST文件夹下边只能有两个文件夹,多了无效
@echo off
::TEST 文件夹下子文件夹的大小容量显示,只能显示两个子文件夹,且子文件夹下不能有三级子文件夹
dir test /s >te.txt
type te.txt | find "a">a.txt
type te.txt | find "b">b.txt
type te.txt | find "字节">zj.txt
type te.txt | find "目录">mulu.txt
find /n "个" zj.txt>suma.txt
find /n "\" mulu.txt>mulua.txt
for /f "tokens=2" %%i in ('findstr [2 mulua.txt') do echo %%i目录的大小为:
for /f "tokens=4-5" %%i in ('findstr [2 suma.txt') do echo %%i %%j
for /f "tokens=2" %%i in ('findstr [3 mulua.txt') do echo %%i目录的大小为:
for /f "tokens=4-5" %%i in ('findstr [3 suma.txt') do echo %%i %%j
del te.txt a.txt b.txt zj.txt mulu.txt suma.txt mulua.txt
pause