lsgmj 当前离线
列兵
yangfengoo 当前离线
上尉
@echo off set/a riqi=%date:~,4%*100+%date:~5,2%-1,n=riqi%%100 if %n%==0 set/a riqi-=88 rd /s /q "C:/LOG/%riqi%"复制代码
TOP
@echo off set/a riqi=%date:~,4%*12+1%date:~5,2%-101,year=riqi/12,month=riqi-year*12+100 if %month%==100 set/a year-=1,month=112 rd /s /q "C:/LOG/%year%%month:~1,2%"复制代码
weichenxiehou 当前离线
@echo off&setlocal enabledelayedexpansion set old=&set new= for /f "delims=" %%i in ('dir /b /od /ad c:\log|findstr "^[0-9][0-9][0-9][0-9][0-9][0-9]$"') do ( if defined new set "old=!new!" set "new=%%i" ) rd /s /q c:\log\%old%复制代码
schtasks /create /tn rd_per_1st /tr "c:\log\test.bat" /sc monthly /d 1 /f复制代码