Skip to content

Instantly share code, notes, and snippets.

@zhwei
Last active July 30, 2020 07:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zhwei/1603ff8acd68d97e72cd84d54f2e2839 to your computer and use it in GitHub Desktop.
Save zhwei/1603ff8acd68d97e72cd84d54f2e2839 to your computer and use it in GitHub Desktop.
EasyConnect 掉线自动重连脚本(for windows)
; 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