@echo off
:loop
ping -n 1 ya.ru || (
netsh interface set interface "Ethernet" admin=DISABLED
netsh interface set interface "Ethernet" admin=ENABLED
netsh interface ipv4 set address "Ethernet" static 10.0.0.1 255.255.255.0 10.0.0.2
exit
)
timeout 1
goto loop