need to make a ping cmd compare send and reseve

September 23, 2012 at 15:20:25
Specs: Windows xp pro
hello i watch a ton of pc need some help with my batch to change the ping and errorleve as it only looks at the last ping not 4 or 10 and average it to compare send to receive. Please help.


See More: need to make a ping cmd compare send and reseve

Report •

#1
September 25, 2012 at 23:06:00
@echo off & setlocal
set sent=
set recd=
set tests=5
for /L %%i in (1 1 %tests%) do (
for /f "tokens=2,4 delims=,=" %%a in ('ping -n 1 192.168.xxx.xxx ^|find /i "lost ="') do (
echo a:%%a
echo b:%%b
set /a sent+=%%a
set /a recd+=%%b
call :xx
)
)
goto :eof
:xx
echo ttls: %sent%
echo ttlr: %recd%
goto :eof

:final
set /a sent*=10
set /a recd*-1000
set /a perc=recd/sent
echo performance percent: %perc%
::======
no clue what exactly you want to do, so this just give you an "engine" to build from.


Report •
Related Solutions


Ask Question