您好我正在尝试创建一个Batch脚本来删除应用程序中的日志文件,如果文件大小更多,这是我的代码。第二次“pushd”
后我收到语法错误@echo off
pushd "C:\Program Files\temp\Logs"
for /f "skip=10 eol=: delims=" %%F in ('dir /b /o-d E*.log') do @del "%%F"
for /f "skip=10 eol=: delims=" %%F in ('dir /b /o-d A*.log') do @del "%%F"
popd
sleep 1
pushd "C:\Program Files\temp\modules\Logs"
set file="P*.log"
set maxbytesize = 10
FOR /F "usebackq" %%A IN ('%file%') DO set size=%%~zA
if %size% GTR %maxbytesize% (
del "%%A"
)