Last active
October 11, 2018 23:24
-
-
Save seanvikoren/51dafb1e07e026f14c06a5110af92809 to your computer and use it in GitHub Desktop.
Creates a log file of ping activity with a settable delay between pings.
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 off | |
SETLOCAL | |
set pingTarget=yahoo.com | |
set fileName=pinglog.txt | |
set waitSeconds=420 | |
echo. | wtee -a %fileName% | |
echo ====================================================== | wtee -a %fileName% | |
echo Starting Ping Loop; Logging to %fileName% | wtee -a %fileName% | |
:timestamp | |
set day=%date:~7,2% | |
set month=%date:~4,2% | |
set year=%date:~10,4% | |
set timestamp=%year%-%month%-%day%_%time% | |
echo. | wtee -a %fileName% | |
echo ------------------------------------------------------ | wtee -a %fileName% | |
echo Ping Timestamp: %timestamp% | wtee -a %fileName% | |
:ping | |
ping %pingTarget% -n 1 | wtee -a %fileName% | |
:wait | |
ping 127.0.0.1 -n %waitSeconds% > nul | |
goto timestamp | |
ENDLOCAL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment