6,850
社区成员
发帖
与我相关
我的任务
分享
@echo off
echo Dont close this windows!
echo Delete the file 2 days ago and directory!
setlocal enabledelayedexpansion
echo set arg=wscript.arguments>"%temp%\temp.vbs"
echo wscript.echo datediff("d",now(),arg(0))>>"%temp%\temp.vbs"
for /f "delims=" %%i in ('dir /ad /b') do (
for /f "delims=" %%a in ('cscript.exe /nologo "%temp%\temp.vbs" "%%~ti"') do (
set d=%%a
)
if !d! lss -2 (
echo %%i
rd /s/q "%%i"
)
)
echo Delete OK