Last active
August 30, 2017 20:05
-
-
Save funvill/e7e7892dfae312d9de2e63cabfd9c41a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo on | |
set ADDRESS=google.com | |
for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set dt=%%a | |
set YYYY=%dt:~0,4% | |
set MM=%dt:~4,2% | |
set DD=%dt:~6,2% | |
set HH=%dt:~8,2% | |
set Min=%dt:~10,2% | |
set Sec=%dt:~12,2% | |
set stamp=%YYYY%-%MM%-%DD%_%HH%-%Min%-%Sec% | |
set OUTPUTFILE="c:\temp\pingtest_%stamp%.log" | |
:Loop | |
ping -t %ADDRESS%|cmd /q /v /c "(pause&pause)>nul & for /l %%a in () do (set /p "data=" && echo(!date! !time! !data!)&ping -n 2 %ADDRESS%>nul" > %OUTPUTFILE% | |
goto Loop |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment