Page 1 of 1

Connect / Disconnect Scripts

Posted: Tue Dec 31, 2019 2:15 pm
by eimundo
Is there a way to have a batch file run on connect / disconnect in the new OpenVPN Connect v3.1 beta?

Re: Connect / Disconnect Scripts

Posted: Thu Apr 16, 2020 7:40 am
by dimitart
I have the exact same question. I'm running OpenVPN connect 3.1.3 on Win7 x64 machine.

So far my experience is the following:
-> My VPN service host provided me with .ovpn file which I imported to the GUI and even have a quick-start shortcut.
-> Once imported, the .ovpn file appears to be copied to "C:\users\xxx\appdata\openvpn connect\temp\PC xxx.ovpn" ("PC " is appended to filename)
-> I tried modifying the ovpn file to run a script by adding

Code: Select all

script-security 2
up 'C:\\temp\\script_up.bat'
Inside the OpenVPN Connect GUI, the log file shows that the commands are parsed from the config file, but the script is not executed.

-> I also tried putting-in the script file in the same directory as the .ovpn file and even renaming it with the "_up" suffix, but still no luck.

Anybody ever had success with this?

Stay safe,
Dimitar