Batch basis (X) calculates the current directory and subdirectories footprint

file_exist.bat file as follows:
Note: This procedure only to the secondary directory

@echo off
echo.
echo 正在统计当前目录所占空间,请稍后......
echo ------------------------------------------
for /f "tokens=*" %%a in ('dir') do (
echo "%%a" | find "个文件" > nul && for /f "tokens=3-4" %%b in ("%%a") do (
echo 当前目录大小:%%b%%c
)
)
echo ------------------------------------------
echo 子目录所占空间大小分别如下:
for /f %%a in ('dir /ad /s /b') do (
for /f "tokens=*" %%b in ('dir %%a') do (
echo "%%b" | find "个文件" > nul && for /f "tokens=3-4" %%c in ("%%b") do (
echo %%a: %%c%%d
)
)
)

Here Insert Picture Description

Published 228 original articles · won praise 44 · Views 100,000 +

Guess you like

Origin blog.csdn.net/qq_40945965/article/details/86751397