Automatic connection and BAT file

How to customize and extend your OpenVPN installation.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Post Reply
sif90
OpenVpn Newbie
Posts: 1
Joined: Mon Mar 14, 2016 4:14 pm

Automatic connection and BAT file

Post by sif90 » Mon Mar 14, 2016 5:07 pm

Hello all!

I'm trying to find a way to run a BAT script when the tunnel has gone up. I have in my Config folder :
- yolo.ovpn
- yolo_up.bat

Yolo_up.bat runs well when i start manually the Open VPN connection (right click, Connect). But i want a automatic connection. So i modified the Open VPN Service target to :
"C:\Program Files\OpenVPN\bin\openvpnserv.exe" --connect yolo.ovpn (Statup Type: Automatic).

Now, the automatic connection work but not yolo_up.bat... :roll:

Ideas?

Thanks !

User avatar
Traffic
OpenVPN Protagonist
Posts: 4066
Joined: Sat Aug 09, 2014 11:24 am

Re: Automatic connection and BAT file

Post by Traffic » Mon Mar 14, 2016 5:56 pm

The --up script is a little teaser because the tunnel is not available to pass data until all scripts have successfully completed.

Why this little factoid is not in the manual is a matter for discussion .. :twisted:

mototopo
OpenVpn Newbie
Posts: 4
Joined: Tue May 31, 2016 7:45 pm

Re: Automatic connection and BAT file

Post by mototopo » Tue May 31, 2016 7:54 pm

hi, i have the same problem :
my _UP.BAT script ends in failure .

I have only one row with a net use command.
with win7 has always worked well ; now with win10 does not finish the script .

You have any ideas on how to fix it ?

FalconTent
OpenVpn Newbie
Posts: 18
Joined: Fri Sep 12, 2014 3:29 pm

Re: Automatic connection and BAT file

Post by FalconTent » Tue May 31, 2016 8:06 pm

Personally, if you followed the Windows 10 upgrade path .. I would roll back to Windows 7.

mototopo
OpenVpn Newbie
Posts: 4
Joined: Tue May 31, 2016 7:45 pm

Re: Automatic connection and BAT file

Post by mototopo » Tue May 31, 2016 8:14 pm

I Had The temptation to Turn back to win7 but my new PC has only win10

User avatar
disqualified
OpenVPN User
Posts: 40
Joined: Fri Jun 03, 2016 7:13 pm

Re: Automatic connection and BAT file

Post by disqualified » Fri Jun 03, 2016 7:19 pm

Read the manual for windows:

Code: Select all

> net help use

mototopo
OpenVpn Newbie
Posts: 4
Joined: Tue May 31, 2016 7:45 pm

Re: Automatic connection and BAT file

Post by mototopo » Mon Jun 06, 2016 8:07 pm

Thanks , but I have not found an indication . can you tell me anything more?

Post Reply