
- 帖子
- 6
- 积分
- 114
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2009-7-11
|
运行显示如下,制定三天前的,但是今天的文件也提示将被删除
E:\>rem 指定待删除文件的存放路径
E:\>set SrcDir=e:\crm
E:\>rem 指定天数
E:\>set DaysAgo=3
E:\>rem 假设日期格式为:星期一 2009-07-13
E:\>call ateToDays 2009 07 13 PassDays
E:\>setlocal ENABLEEXTENSIONS
E:\>set yy=2009 & set mm=07 & set dd=13
E:\>if 12009 LSS 200 if 12009 LSS 170 (set yy=202009 ) else (set yy=192009 )
E:\>set /a dd=10013%100,mm=10007%100
E:\>set /a z=14-mm,z/=12,y=yy+4800-z,m=mm+12*z-3,j=153*m+2
E:\>set /a j=j/5+dd+y*365+y/4-y/100+y/400-2472633
E:\>endlocal & set PassDays=14438 & goto :EOF
E:\>set /a PassDays-=3
E:\>call :DaysToDate 14435 DstYear DstMonth DstDay
E:\>setlocal ENABLEEXTENSIONS
E:\>set /a a=14435+2472632,b=4*a+3,b/=146097,c=-b*146097,c/=4,c+=a
E:\>set /a d=4*c+3,d/=1461,e=-1461*d,e/=4,e+=c,m=5*e+2,m/=153,dd=153*m+2,dd/=5
E:\>set /a dd=-dd+e+1,mm=-m/10,mm*=12,mm+=m+3,yy=b*100+d-4800+m/10
E:\>(if 7 LSS 10 set mm=07 ) & (if 10 LSS 10 set dd=010 )
E:\>endlocal & set DstYear=2009 & set DstMonth=07 & set DstDay=10 & goto :EOF
E:\>set DstDate=2009-07-10
E:\>for /R "e:\crm" %a in (*.*) do (if "%~ta" LEQ "2009-07-10" (if exist "%a" (e
cho del /f /q "%a" ) ) )
E:\>(if "08-10-30 08:21 " LEQ "2009-07-10" (if exist "e:\crm\20081030082017hjfor
est@技术规范确认书及项目明细.xls" (echo del /f /q "e:\crm\20081030082017hjforest
@技术规范确认书及项目明细.xls" ) ) )
del /f /q "e:\crm\20081030082017hjforest@技术规范确认书及项目明细.xls"
E:\>(if "08-10-30 08:27 " LEQ "2009-07-10" (if exist "e:\crm\20081030082615hjfor
est@华俊和集团车型对照表.xls" (echo del /f /q "e:\crm\20081030082615hjforest@华
俊和集团车型对照表.xls" ) ) )
del /f /q "e:\crm\20081030082615hjforest@华俊和集团车型对照表.xls"
E:\>(if "08-10-30 08:41 " LEQ "2009-07-10" (if exist "e:\crm\20081030083809hjlll
@营销服务部各岗位人员信息表.doc" (echo del /f /q "e:\crm\20081030083809hjlll@营
销服务部各岗位人员信息表.doc" ) ) )
del /f /q "e:\crm\20081030083809hjlll@营销服务部各岗位人员信息表.doc"
E:\>(if "09-07-12 04:04 " LEQ "2009-07-10" (if exist "e:\crm\mycrm50200907120400
00.bak" (echo del /f /q "e:\crm\mycrm5020090712040000.bak" ) ) )
del /f /q "e:\crm\mycrm5020090712040000.bak"
E:\>(if "09-07-13 04:04 " LEQ "2009-07-10" (if exist "e:\crm\mycrm50200907130400
00.bak" (echo del /f /q "e:\crm\mycrm5020090713040000.bak" ) ) )
del /f /q "e:\crm\mycrm5020090713040000.bak"
E:\>(if "09-07-11 14:46 " LEQ "2009-07-10" (if exist "e:\crm\新建 WPS演示 演示文
稿.dps" (echo del /f /q "e:\crm\新建 WPS演示 演示文稿.dps" ) ) )
del /f /q "e:\crm\新建 WPS演示 演示文稿.dps"
E:\>pause
请按任意键继续 . . . |
|