Skip to content

Instantly share code, notes, and snippets.

@oliverlabs
Created July 21, 2023 13:13
Show Gist options
  • Save oliverlabs/f86f990c82be8d9c05962f42f005be27 to your computer and use it in GitHub Desktop.
Save oliverlabs/f86f990c82be8d9c05962f42f005be27 to your computer and use it in GitHub Desktop.
This script triggers the built-in Windows VPN client and auto-connects
rasphone "<INSERT-YOUR-VPN-CONNECTION-NAME>"
$wshell = New-Object -ComObject wscript.shell;
$wshell.AppActivate('Network Connections')
Sleep 2
$wshell.SendKeys('~')
Sleep 2
$wshell.SendKeys('~')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment