Computing

How to have a batch file to mass check ping locations

Here is a simple ping command in a batch file that allows you to add servers/addresses to ping and it will return the ping time for all at once.

An aspect of a ping check is when you get the time (latency) that it takes to send and then receive data. The closer the server/location should mean your ping times will be low.

Ping is crucial in network speed as it is the variable most responsible for lag. Having a low ping to a server can be an indication that your speeds to and from the server will be fast.

The .bat file is:

:start
@ECHO off
CALL:pingr 108.61.219.200
ECHO - (USA) LA:                      %ms%
CALL:pingr 104.156.244.232
ECHO - (USA) Miami:                   %ms%
CALL:pingr 108.61.196.101
ECHO - (EU) London:                   %ms%
CALL:pingr 45.32.100.168
ECHO - (ASIA) Singapore:              %ms%
pause
cls
goto Start
 
:pingr
SET ms=Error
FOR /F "tokens=4 delims==" %%i IN ('ping.exe -n 1 %1 ^| FIND "ms"') DO SET ms=%%i
GOTO:EOF

The above is using Vultr supplied addresses and when the file is double-click it will return the ping results in the command prompt like so

Share

Recent Posts

Kennington reservoir drained drone images

A drained and empty Kennington reservoir images from a drone in early July 2024. The…

1 year ago

Merrimu Reservoir drone images

Merrimu Reservoir from drone. Click images to view larger.

1 year ago

FTP getting array of file details such as size using PHP

Using FTP and PHP to get an array of file details such as size and…

2 years ago

Creating Laravel form requests

Creating and using Laravel form requests to create cleaner code, separation and reusability for your…

2 years ago

Improving the default Laravel login and register views

Improving the default Laravel login and register views in such a simple manner but making…

2 years ago

Laravel validation for checking if value exists in the database

Laravel validation for checking if a field value exists in the database. The validation rule…

2 years ago