删除文件,保留最近多少个文件 @set LogDir=D:Log for /f "skip=10" %%i in ('dir %LogDir%apache-access-*.log /tc /o-d /b') do del %LogDir%\%%i