-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathStabilityPing.bat
63 lines (44 loc) · 1.24 KB
/
StabilityPing.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
::BATCH FOR TESTING CONNECTION STABILITY
@echo off
setlocal
REM get Start time
set "Starttime=%time%"
echo Start: %Starttime%
REM Target Adress
set TargetHost=88.99.192.186
REM Number of tracer Hops
set TracertHops=30
REM Number of Tracer-loops
set loops=10
REM Number of sended pakets
set Pakets=100
set results=ResultsOfPing.txt
echo pings sending now
REM Ping running
ping %TargetHost% -n %Pakets% > %results%
REM breakline
echo ------------------------------------- >> %results%
echo start Traceroute
for /l %%i in (1,1,%loops%) do (
REM tracert running
tracert -h %TracertHops% %TargetHost% >> %results%
echo Traceroute test number: %%i
echo. >> %results%
)
REM show results
type %results%
echo Ping test and Traceroute end
REM get end time
set "Endtime=%time%"
REM calculation of seconds
for /f "tokens=1-3 delims=:." %%a in ("%Starttime%") do (
set /a "StartSeconds=(((%%a*60)+1%%b %% 100)*60)+1%%c %% 100"
)
for /f "tokens=1-3 delims=:." %%a in ("%Endtime%") do (
set /a "EndSeconds=(((%%a*60)+1%%b %% 100)*60)+1%%c %% 100"
)
set /a "totalDuration=EndSeconds - StartSeconds"
REM show total duration time
echo total duration: %totalDuration% seconds
endlocal
exit /b