@echo off for %%a in (A.txt) do ( echo.大小为:%%~za if "%%~za"=="307200" ( echo.OK ) else ( del /f/q "A.txt" ren "B.txt" "A.txt" ) ) rem 理论上300KB是等于307200字节的,具体情况还要楼主自己修改。复制代码