Since a connectivity issue between a Windows XP system in another country and systems in the United States seemed to correlate with the time of day that connectivity attempts were taking place, I wanted to have a batch file that would periodically ping from the source to the destination hosts and record the results, so that I could determine if packet loss was occurring at particular times every day because of contention with other traffic. So I created the following batch file (pinghosts.bat):
@echo off set pingCount=5 set timeOut=500 set dirPath=%HOMEPATH%\Documents REM ping google.com, apple.com, and cisco.com for %%i in ("216.58.217.142" "17.142.160.59" "72.163.4.161") do ( if not exist %dirPath%\%%i.txt ( systeminfo | find "Time Zone:" > %dirPath%\%%i.txt ) echo. >> %dirPath%\%%i.txt echo %date% %time% >> %dirPath%\%%i.txt ping -n %pingCount% -w %timeOut% %%i >> %dirPath%\%%i.txt )
[ More Info ]