拷贝加删除:- @echo off
- cd/d "本地路径"
- for /f "tokens=1-3 delims=-:/ " %%a in ("%date%") do set Y=%%a&set M=%%b&set D=%%c
- set M_=0%M%&set D_=0%D%
- set C0=%Y%%M_:~-2%%D_:~-2%2000.dmp
- if %M:~0,1%==0 set M=%M:~1%
- if %D:~0,1%==0 set D=%D:~1%
- set/a D-=5
- if %D% leq 0 call:C %D%
- set M=0%M%&set D=0%D%
- set C5=%Y%%M:~-2%%D:~-2%2000.dmp
- for %%a in (*.dmp) do if "%%a" leq "%C5%" del /f/a "%%a"
- copy %C0% "网络路径\%C0%"
- exit
- :C
- set/a M-=1,Y-=!M,M+=!M*12,"C=!(M-4)|!(M-6)|!(M-9)|!(M-11)","D+=!(M-2)*(28+(!(Y%%4)&!!(Y%%100))|!(Y%%400))+C*30+(!!(M-2)&!C)*31"
- if %D% leq 0 goto:C
复制代码
[ 本帖最后由 hanyeguxing 于 2011-1-4 22:41 编辑 ] |