I have to use VPN app to login to our corporate network (Pulse Secure). It is very cumbersome and breaks connection every few hours and asks for password again and again. There is no way to save name/pass in that app.
I have managed to write an AutoIt script that does initial login. But it does not work stable on my win7 and it does not reconnect automatically. Moreover it is not secure as the password is there in plain text. Unfortunately I was not able to implement master-pass scheme - provided Autoit functions simply did not work (or I am being too lazy to investigate).
I am using RoboForm for web forms filling - maybe it is capable of automatic windows form filling and submission? Or any other software (LastPass?) is capable of:
- Detect that particular window has been activated (by window class or caption or both)
- Automatically fill fields in that windows and press button
My autoit script for pulse secure:
#include <Constants.au3>
;
; AutoIt Version: 3.0
; Language: English
; Platform: Win9x/NT
; Author: AKA
;
; Script Function:
; Connects Pulse Secure.
;#AutoIt3Wrapper_Run_Debug_Mode=Y
; kill existing
ProcessClose ( "pulse.exe" )
;Sleep(2000)
Run("C:\Program Files (x86)\Common Files\Juniper Networks\JamUI\Pulse.exe")
;splash bypass
WinWaitActive("[TITLE:Splash; CLASS:JamShadowClass]")
WinWaitNotActive("[TITLE:Splash; CLASS:JamShadowClass]")
;get main window active
Local $hWnd = WinWaitActive("[TITLE:Pulse Secure; CLASS:JamShadowClass]")
;connect
ControlClick($hWnd, "", "[TEXT:Connect; CLASSNN:JAM_BitmapButton8]")
;AutoItSetOption("SendKeyDelay", 400)
;wait connect window
Local $hWnd = WinWaitActive("[TITLE:Connect to: KB; CLASS:JamShadowClass]")
Send("password")
Send("{ENTER}")
WinWaitNotActive("[TITLE:Connect to: KB; CLASS:JamShadowClass]")
WinClose("[TITLE:Pulse Secure; CLASS:JamShadowClass]")
AutoItSetOption ("MouseCoordMode", 0)
or see if it'd help any for Window clicks... I also always use the#RequireAdmin
up top too... Look intoControlSend
as well... plus look intoIf WinExists()
and / orIf Not WinExists()
functions for checking if something does or does not need to run... Just quick ideas for things I've used that do run successful to do something when it runs and I'm not on the machine... it's solid for me.... just quick ideas though but your logic looks good too...