I asked the same thing, but what everyone says is true, ping will not measure bandwidth well. this batch, listed below, is a ping bandwidth test, but its limit is up to 1000 kbps and in this simple form is not rounded, but you can play with it and experiment.
@echo off
:begin
color 0b
MODE CON:COLS=15 LINES=3
for /F "tokens=10 delims=ms=," %%a in ('ping -n 1 -w 1000 -l 1024 8.8.8.8^| find "Average"') do set "A1=%%a"
set /a T=%A1%
set /a varia=1000/%T%
set /a answer=%varia%
set /a varia2=%answer%
set /a answer2=%varia2%
echo.
echo Speed %answer2% Kb/s
sleep 5
goto begin
source
share