Last active
July 30, 2020 07:59
-
-
Save zhwei/1603ff8acd68d97e72cd84d54f2e2839 to your computer and use it in GitHub Desktop.
EasyConnect 掉线自动重连脚本(for windows)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; author: zhwei | |
; url: https://gist.github.com/zhwei/1603ff8acd68d97e72cd84d54f2e2839 | |
Func StopProcessByName($process) | |
If ProcessExists($process) Then | |
ProcessClose($process) | |
$result = ProcessWaitClose($process, 30) | |
If $result < 1 Then | |
MsgBox(16, "退出失败", $process) | |
Exit | |
Endif | |
EndIf | |
EndFunc | |
Func LogInEzConnect() | |
WinWait("EasyConnect", "登录", 10); | |
ControlClick("EasyConnect", "登录", 1086); | |
WinWait("EasyConnect", "重新登录", 864000); | |
ControlClick("EasyConnect", "重新登录", 1000); | |
LogInEzConnect() | |
EndFunc | |
StopProcessByName("SangforCSClient.exe") | |
Run("C:\Program Files (x86)\Sangfor\SSL\SangforCSClient\SangforCSClient.exe"); | |
LogInEzConnect() | |
Exit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment