Kodlar .bat olarak kayıt edilmeli. Hedef IP adresi zaman kaydı tutularak pingleme işlemi yapılır. -l 9999 değişkeni ile paket boyutu büyük ayarlandı, istenmiyorsa kaldırılabilir. Log dosyası oluşturacaktır.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
@echo off set saat=%time:~0,2% if %saat% LSS 10 set saat=0%saat:~1,1% set /p host=host Address: set logfile=Log_%host%%date:~10,4%%date:~7,2%%date:~4,2%%saat%00.log echo Target Host = %host% >%logfile% for /f "tokens=*" %%A in ('ping %host% -n 1 -l 9999') do (echo %%A>>%logfile% && GOTO Ping) :Ping for /f "tokens=* skip=2" %%A in ('ping %host% -n 1 -l 9999') do ( echo %date% %time:~0,2%:%time:~3,2%:%time:~6,2% %%A>>%logfile% echo %date% %time:~0,2%:%time:~3,2%:%time:~6,2% %%A timeout 1 >NUL GOTO Ping) |