This should ping the IP address and on failure it will disconnect, pause for 10 seconds, start the vpnclient and pause for 10 seconds, then loop.
There is a 30 second delay between tests.
The timeout
command is in Vista and later.
@echo off
cd /d "C:\Program Files (x86)\Cisco Systems\VPN"
:loop
echo testing IP address
ping 123.456.78.90 >nul || (
echo ping failure - disconnecting
vpnclient disconnect
timeout /t 10 /nobreak
echo reconnecting
start vpnclient connect rcx user TESTE pwd TESTE stdin
timeout /t 10 /nobreak
)
timeout /t 30 /nobreak
goto :loop