I have rudimentary skills with batch files, nearly 60 yers old. I'm trying to find the fastest server within my VPN provider. So using a servers.txt list of 15-20 servers like this:
lax-a03.ipvanish.com
lax-a04.ipvanish.com
lax-a05.ipvanish.com
lax-a06.ipvanish.com.......
I'm trying to get the "Average" round trip response time of each server and have that output to a "results.txt" file.
This data is in the last line of ping results (Minimum = 21ms, Maximum = 25ms, Average = 23ms)
I have found many batch files that ping a server but they are checking for connection status, or generate the IP, for just one server, or something other than ms response time. Any help would be appreciated.
This is all I found that would use a list. However, it doesn't produce results to a file or produce the response time (ms).
for /f %%i in (servers.txt) do ping %%i
Ping VPN List of Servers - Output Avg Response Time
Moderator: DosItHelp
Re: Ping VPN List of Servers - Output Avg Response Time
azmedia wrote:I'm trying to get the "Average" round trip response time of each server and have that output to a "results.txt" file.
This data is in the last line of ping results (Minimum = 21ms, Maximum = 25ms, Average = 23ms)
Test this:
Code: Select all
@echo off
(
for %%a in (
lax-a03.ipvanish.com
lax-a04.ipvanish.com
lax-a05.ipvanish.com
lax-a06.ipvanish.com
) do (
echo pinging %%a 1>&2
echo %%a
ping %%a -n 10 |find "Average ="
)
)>"logfile.txt"
Re: Ping VPN List of Servers - Output Avg Response Time
foxidrive - thank you so much. This is excellent, much better than creating a txt list of servers to feed the batch file. Thanks again!!!!