MoonPoint Support Logo

 


Shop Amazon Warehouse Deals - Deep Discounts on Open-box and Used ProductsAmazon Warehouse Deals



Advanced Search
May
Sun Mon Tue Wed Thu Fri Sat
 
18
29 30 31      
2017
Months
MayJun
Jul Aug Sep
Oct Nov Dec


Thu, May 18, 2017 10:08 pm

Batch file to ping several hosts and log results

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 ]

[/os/windows/commands/batch] permanent link

Once You Know, You Newegg AliExpress by Alibaba.com

Shop Amazon Local - Subscribe to Deals in Your Neighborhood

Valid HTML 4.01 Transitional

Privacy Policy   Contact

Blosxom logo