mode con cols=100 lines=5 color 47 @echo off set ip=192.168.188.254 set datevar=%date:~0,4%-%date:~5,2%-%date:~8,2% set timevar=%time:~0,2% if /i %timevar% LSS 10 ( set timevar=0%time:~1,1% ) set timevar=%timevar%:%time:~3,2%:%time:~6,2% @echo ping %ip% %datevar% %timevar% for /l %%i in (1,1,%999999999%) do ( @echo %datevar% %timevar% >>%ip%_%datevar%.log ping %ip%>>%ip%_%datevar%.log )