@echo off setlocal EnableDelayedExpansion
del 1.txt /q
del 2.txt /q
for %%i in (*) do (echo %%~fzi >>1.txt) rem 将文件大小存储到1.txt
for /f "tokens=1* delims= " %%a in (1.txt) do (
set "zer=%%a"
set "pat=%%b"
if !zer! gtr 5120 (
if not "!pat:~0,-1!"=="%~0" echo "!pat:~0,-1!" echo "!pat!" >> 2.txt rem 将大于5KB的文件名称放到2.txt中
)
)
echo "done."