@echo off for /f "tokens=3" %%a in ('dir /a/-c "目录"') do ( call set var=%%num%% set num=%%a ) echo %var% 字节 pause复制代码