Start/Stop OpenVPN Question

Phelptwan

Supreme [H]ardness
Joined
Jul 20, 2002
Messages
6,804
Hopefully this is a simple question, but here it goes.

I have a very simple setup with OpenVPN from my house to a backup server at a friends house (Windows to Windows). I basically do a robocopy /MIR of a couple directories on the servers daily (they backup their files to mine, mine to theirs, etc).

I was leaving OpenVPN running all the time, but started PLEX on both servers and keep having performance and related issues with PLEX when OpenVPN is running.

My idea was to script OpenVPN to start/connect, run the RoboCopy jobs, then disconnect. Problem is, however I script or run the autostart for OpenVPN, it waits for the process to complete and doesn't continue to the robocopy commands. I feel like I'm missing something really stupid.


Batch file as is;
________________________________________
C:\PATH\OpenVPN-GUI.exe --config client.ovpn

Robocopy 1
Robocopy 2

taskkill.exe /F /IM openvpn-gui.exe
 
Add start to the front to run in the background and add a ten second delay:

Code:
start "OpenVPN" C:\PATH\OpenVPN-GUI.exe --config client.ovpn

ping 127.0.0.1 -n 10 >NUL 2>&1 || ping ::1 -n 10 >NUL 2>&1

Robocopy 1
Robocopy 2

taskkill.exe /F /IM openvpn-gui.exe
 
Add start to the front to run in the background and add a ten second delay:

Code:
start "OpenVPN" C:\PATH\OpenVPN-GUI.exe --config client.ovpn

ping 127.0.0.1 -n 10 >NUL 2>&1 || ping ::1 -n 10 >NUL 2>&1

Robocopy 1
Robocopy 2

taskkill.exe /F /IM openvpn-gui.exe

Thanks I was missing the "Task Name" when I was trying the start command. That took care of it.
 
Back
Top