Skip to content

Instantly share code, notes, and snippets.

@elpatron68
Last active December 21, 2020 16:47
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 elpatron68/c8c2a12e3899e6a8b099e683e9c37ea1 to your computer and use it in GitHub Desktop.
Save elpatron68/c8c2a12e3899e6a8b099e683e9c37ea1 to your computer and use it in GitHub Desktop.
Automatic log in for MeshCentral Router
Opt("WinTitleMatchMode", 3)
While 1
Login()
Sleep(50)
WEnd
Func Login()
If WinActive(" MeshCentral Router", "") Then
; Get the window handle
Local $hWnd = WinWait(" MeshCentral Router", "", 1)
; Set focus to the password field
ControlFocus($hWnd, "", "WindowsForms10.EDIT.app.0.141b42a_r6_ad11")
; Delete former content
Send("+{HOME}")
Send("{BACKSPACE}")
Sleep(20)
; Send password
Send("SECRETPASSWORD")
; Login
Send("{TAB}{ENTER}")
Sleep(1000)
EndIf
EndFunc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment