- 帖子
- 12
- 积分
- 184
- 技术
- 0
- 捐助
- 0
- 注册时间
- 2008-8-1
|
我自己写了个,不过执行效率相当的低,而且双重判断还会出错,批处理不可能双重判断吗?
@echo off
if exist cjl.txt goto start
for /f "tokens=1,2,3" %%i in ('systeminfo^|find "系统启动时间:"') do set starttime=%%k
set starttime=%starttime:~0,5%
set starttime=%starttime::=%
set nowtime=%time:~0,5%
set nowtime=%nowtime::=%
set/a starttime1=%starttime%+200
set/a starttime2=%starttime%+400
set/a starttime3=%starttime%+600
set/a starttime4=%starttime%+800
set/a starttime5=%starttime%+1000
echo 系统启动时间: %starttime%
echo 当前时间: %nowtime%
echo 系统启动时间+2小时: %starttime1%
echo 系统启动时间+4小时: %starttime2%
echo 系统启动时间+6小时: %starttime3%
echo 系统启动时间+8小时: %starttime4%
echo 系统启动时间+10小时: %starttime5%
copy nul cjl.txt
::pause&exit
if %nowtime% lss %starttime5%(if %nowtime% gtr %starttime4% goto four)
if %nowtime% lss %starttime4%(if %nowtime% gtr %starttime3% goto three)
if %nowtime% lss %starttime3%(if %nowtime% gtr %starttime2% goto twp)
if %nowtime% lss %starttime2%(if %nowtime% gtr %starttime1%) goto one
if %nowtime% lss %starttime1% goto time
pause
:time
mshta vbscript:createobject("wscript.shell").popup("上机不足两小时,每两小时可以抽奖一次",3,"警告",32)(window.close)
exit
:error
mshta vbscript:createobject("wscript.shell").popup("每两小时只能抽奖一次",3,"警告",32)(window.close)
exit
ne
if exist one.txt goto error
start netclient.exe
copy nul one.txt
exit
:two
if exist two.txt goto error
start netclient.exe
copy nul two.txt
exit
:three
if exist three.txt goto error
start netclient.exe
copy nul three.txt
exit
:four
if exist four.txt goto error
start netclient.exe
copy nul four.txt
exit
:fine
if exist fine.txt goto error
start netclient.exe
copy nul fine.txt
exit |
|