Page 1 of 1

Remote connecting to server (by incoming email)

Posted: Thu Jun 21, 2018 5:37 am
by kt368
Hi everyone!

I'm trying to realize such functionality:
I have Win 10 PC with installed OpenVPN client. At this PC I already have installed and always running Mozilla Thunderbird mail client. I want the VPN client to connect to the server if Mozilla received the email.

For this behavior I'm plan to use such scheme: When incoming email is received by Mozilla, it's extension "Mailbox Alert" executes bat file, which run openvpn client which are connecting to server.
But I can't create bat file, which will able to cennect to VPN server.
I've trying this bat file:

Code: Select all

cd "C:\Program Files\OpenVPN\bin"
START "" /B openvpn.exe --config config.ovpn
It connects to VPN, but can't add routes due to non admin user. If I'm run this bat file as administrator, connection and adding routes are performing normally.
How I can create bat file for connecting to OpenVPN server and adding routes for use in my automatization case?