Created
June 21, 2017 09:36
-
-
Save g3rhard/cc2291371001de46e909385af64da3a7 to your computer and use it in GitHub Desktop.
Bat script for reconnect VPN connection in Windows
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
:loop | |
echo testing IP address | |
ping 123.456.78.90 >nul || ( | |
echo ping failure - disconnecting | |
rasdial name_of_your_vpn_connect /disconnect | |
timeout /t 10 /nobreak | |
echo reconnecting | |
rasdial name_of_your_vpn_connect | |
timeout /t 10 /nobreak | |
) | |
timeout /t 30 /nobreak | |
goto :loop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It works perfectly thank you @picolino