<div class="news_item">#427<div class="news_title">OpenVPN, AutoHotkey saves the day.
Posted by dandriff on Wednesday June 02, 2010@05:13PM
So I really didn't want to remember an insane password to connect to my OpenVPN, and I don't have the luxury of controller the certificate signing, meaning that I can't create a signed key certificate file to use.
Disclaimer: I realize the solution described in this post is not ideal, but IMO it's better than keeping the password in a plain-text file on the desktop (like my boss does).
AutoHotkey can be found here.
AHK Script:
#Persistent
SetTimer, EnterAuth, 250
return
EnterAuth:
Process, wait, openvpn-gui.exe, 2
If %ErrorLevel% = 0
{
Run, C:\Program Files (x86)\OpenVPN\config\shortcut.lnk
Sleep, 2000
}
IfWinExist OpenVPN - User Authentication
{
ControlSetText, Edit1, {USERNAME}, OpenVPN - User Authentication ahk_class #32770
ControlSetText, Edit2, {PASSWORD}, OpenVPN - User Authentication ahk_class #32770
ControlSend, Edit1, {Enter}, OpenVPN - User Authentication ahk_class #32770
ExitApp
}
return
"C:\Program Files (x86)\OpenVPN\bin\openvpn-gui-1.0.3.exe" --connect my-openvpn-config.ovpn