|
- #include <Misc.au3>
- #include <Timers.au3>
- If _Singleton("test", 1) = 0 Then Exit
- #pragma compile(UPX, true)
- #pragma compile(Compression, 9)
- #pragma compile(FileDescription, "循环检测001.exe,然后操作002.exe,且每30分钟重启001.exe")
- Local $starttime, $nowtime, $endtime
- $starttime = _Timer_Init()
- While 1
- $nowtime = Round(_Timer_Diff($starttime)/1000,2)
- $endtime = $nowtime/1800
- If ProcessExists("001.exe") And StringIsInt($endtime) Then
- ProcessClose("001.exe")
- ElseIf Not ProcessExists("001.exe") Then
- ShellExecute("002.exe")
- If ProcessExists("002.exe") Then
- Sleep(10000)
- ProcessClose("002.exe")
- EndIf
- Sleep(10000)
- $nowtime -= 20
- EndIf
- WEnd
复制代码 |
|