Connect / Disconnect Scripts

How to customize and extend your OpenVPN installation.
Post Reply
OpenVpn Newbie
Posts: 1
Joined: Tue Dec 31, 2019 2:08 pm

Connect / Disconnect Scripts

Post by eimundo » Tue Dec 31, 2019 2:15 pm

Is there a way to have a batch file run on connect / disconnect in the new OpenVPN Connect v3.1 beta?

OpenVpn Newbie
Posts: 1
Joined: Thu Apr 16, 2020 7:31 am

Re: Connect / Disconnect Scripts

Post by dimitart » Thu Apr 16, 2020 7:40 am

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,

Post Reply