延迟1小时要求:
1,%date%形如“2010-01-24 ...”
2,%time%形如“ 9:55:37.88”(9前面有一个空格)
3,桌面位于 %userprofile%\桌面- @echo off
- set H=%time:~0,2%&set S=%time:~3%
- set/a H=%H: =%+1,H=H*!!(H-24),D=1%date:~8,2%%%100+!H,Y=%date:~0,4%,M=1%date:~5,2%-100,"K=!(M-4)|!(M-6)|!(M-9)|!(M-11)","E=!(M-2)*(28+!(Y%%4))+K*30+(!!(M-2)&!K)*31"
- if %D% gtr %E% set/a D=1,M+=1
- if %M%==13 set/a M=1,Y+=1
- set M=0%M%&set D=0%D%&set H= %H%
- :p
- >>"%userprofile%\桌面\ping.txt" ping.exe 192.168.0.1 -l 35500
- if "%date:~0,10%%time%" leq "%Y%-%M:~-2%-%D:~-2%%H:~-2%:%S%" goto:p
复制代码
[ 本帖最后由 hanyeguxing 于 2011-1-24 21:48 编辑 ] |