以下是我自己写的代码,但能力有限,漏洞百出,望有能力之大侠帮忙改善
下面有注释,请详细看明注释内容帮我修改脚本或重写符合要求的脚本。 | @echo off | | for /f "skip=1 tokens=1" %%i in ('wmic os get lastbootuptime') do set starttime=%%i | | set starttime=%starttime:~8,4% | | echo %starttime% | | | | | | set nowtime=%time:~0,5% | | set nowtime=%nowtime::=% | | | | | | set/a starttime1=%starttime%+50 | | set/a starttime2=%starttime%+100 | | set/a starttime3=%starttime%+150 | | set/a starttime4=%starttime%+200 | | set/a starttime5=%starttime%+250 | | set/a starttime6=%starttime%+300 | | | | | | | | if /i %nowtime% lss 0800 (if /i %nowtime% gtr 0300 (exit)) | | if /i %nowtime% lss %starttime1% (goto time) | | if /i %nowtime% lss %starttime2% (if /i %nowtime% gtr %starttime1% (goto one)) | | if /i %nowtime% lss %starttime3% (if /i %nowtime% gtr %starttime2% (goto two)) | | if /i %nowtime% lss %starttime4% (if /i %nowtime% gtr %starttime3% (goto three)) | | if /i %nowtime% lss %starttime5% (if /i %nowtime% gtr %starttime4% (goto four)) | | if /i %nowtime% lss %starttime6% (if /i %nowtime% gtr %starttime5% (goto fine)) | | | | | | | | | | | | | | | | | | :time | | start qqad.exe | | start wbnote.exe | | set nowtime= | | set starttime= | | set starttime1= | | set starttime2= | | set starttime3= | | set starttime4= | | set starttime5= | | set starttime6= | | exit | | | | :error | | start qqad.exe | | start wbnote.exe | | set nowtime= | | set starttime= | | set starttime1= | | set starttime2= | | set starttime3= | | set starttime4= | | set starttime5= | | set starttime6= | | exit | | | | | | :one | | if exist c:\windows\one.txt goto error | | start netclient.exe | | copy nul c:\windows\one.txt | | exit | | | | :two | | if exist c:\windows\two.txt goto error | | start netclient.exe | | copy nul c:\windows\two.txt | | exit | | | | :three | | if exist c:\windows\three.txt goto error | | start netclient.exe | | copy nul c:\windows\three.txt | | exit | | | | :four | | if exist c:\windows\four.txt goto error | | start netclient.exe | | copy nul c:\windows\four.txt | | exit | | | | :fine | | if exist c:\windows\fine.txt goto error | | start netclient.exe | | copy nul c:\windows\fine.txt | | exitCOPY |
|