@echo off
REM === 1. START VPN CONNECTIONS ===
set OVPN="C:\Program Files\OpenVPN\bin\openvpn.exe"
set CONFIG_DIR="C:\Program Files\OpenVPN\config"
echo Starting OpenVPN connections...
start "" %OVPN% --config %CONFIG_DIR%\EANAN-BEL-OPS_client_L3_51.112.57.101_1710_Combined.ovpn
start "" %OVPN% --config %CONFIG_DIR%\EANAN-BEL-OPS_client_L3_51.112.57.101_1711_Combined.ovpn
REM Wait for VPN tunnels to establish
echo Waiting for VPN to connect...
timeout /t 15
REM === 2. START VIDEO STREAMS (VLC) ===
echo Starting video streams...
start "" "C:\Program Files\VideoLAN\VLC\vlc.exe" --no-one-instance rtsp://10.17.110.11:8554/video1
start "" "C:\Program Files\VideoLAN\VLC\vlc.exe" --no-one-instance rtsp://10.17.110.11:8556/main.264
REM Small delay to avoid overload
timeout /t 5
REM === 3. START MISSION PLANNER ===
echo Launching Mission Planner...
start "" "C:\Program Files (x86)\Mission Planner\MissionPlanner.exe"
REM Wait for UI to load
timeout /t 8
REM OPTIONAL: auto-press Connect (only if needed)
powershell -command ^
"$wshell = New-Object -ComObject wscript.shell; ^
Start-Sleep -Milliseconds 500; ^
$wshell.AppActivate('Mission Planner'); ^
Start-Sleep -Milliseconds 500; ^
$wshell.SendKeys('{ENTER}')"
echo All systems launched.