Sorry for the late answer (13 years!...)
@echo off
cd "c:\Program Files\Fortinet\FortiClient"
:repeat echo Launching FortiClient IPSEC.... ipsec -b -k switches if %errorlevel% gtr 0 goto error
:CheckConnection ping -n 1 hostname if %errorlevel% gtr 0 goto CheckConnection
echo Connected! echo Launching hostname RDP... start mstsc xxxxxx.RDP exit :error echo Error! %errorlevel Trying again... goto repeat
You can use also -w timeout to let the single ping enough time to accomplish.
mister2x wrote:If program exist you can use tasklist.exe
(- if the program exits kill the vpn connection) (- disable forticlient virtual adapter)
Taskkill.exe to kill
Fortigate <3
The Fortinet Security Fabric brings together the concepts of convergence and consolidation to provide comprehensive cybersecurity protection for all users, devices, and applications and across all network edges.
Copyright 2024 Fortinet, Inc. All Rights Reserved.