Skip to content

Instantly share code, notes, and snippets.

@edihasaj
Created October 25, 2021 07:18
Show Gist options
  • Save edihasaj/189db36fcc6fd9916c0b48cf2449f0e6 to your computer and use it in GitHub Desktop.
Save edihasaj/189db36fcc6fd9916c0b48cf2449f0e6 to your computer and use it in GitHub Desktop.
AnyConnect auto-connect
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.Run """%PROGRAMFILES(x86)%\Cisco\Cisco AnyConnect Secure Mobility Client\vpnui.exe"""
WScript.Sleep 2000
WshShell.AppActivate "Cisco AnyConnect Secure Mobility Client"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "VPN_DOMAIN_OR_IP"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{TAB}"
WshShell.SendKeys "{ENTER}"
WScript.Sleep 11000
WshShell.SendKeys "VPN_PASSWORD"
WshShell.SendKeys "{ENTER}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment