avhimkov
3/18/2017 - 8:18 AM

ping time

ping time

@echo off
ping 11.0.0.13 -t > c:\avtoprocesing.txt
@echo off
set IP=192.168.1.1
@:begin
@for /f "tokens=1*" %%i in ('ping -n 1 %IP% ^| findstr /i "TTL Превышен"') do set n="%%i %%j"

@if defined n (goto log)
set n="Error"
@:log
@echo %n%
@echo %date% %time% %n% >> ping_log.txt
ping -n 2 127.0.0.1 > nul
@goto begin