Reputation: 3
I am looking for a batch script that can constantly ping a server. When the ping fails there would be logic to stop the ping, then disable and enable network adapters.
Upvotes: 0
Views: 478
Reputation: 9545
Something like this :
@echo off&cls
:loop
Echo connection Test...
ping www.google.com >nul || (
Echo Reseting the connection...
netsh interface set interface "Name of the connection" Disable
netsh interface set interface "Name of the connection" Enable
)
::Change the value (300) to in/decrease the time value between 2 tests
ping localhost -n 300 >nul
goto:loop
Upvotes: 1