I have a small script that I got from the net. This script basically reads the information (ip addresses) from a file and pings them and then inserts the results in a text file. This script does exactly what I need but the issue is that instead of ping I need “pathping” which I can change in the script. The issue is that during pathping if there is a delay the script sits for like 3 minutes or maybe 5 minute depending on the response before moving to the next Ip address.
All I want is some kind of time out basically maybe like 20 sec and move to the next record regardless of what the response is. Can someone please modify the script below so that the pathping command waits for like 30 sec and then move to the next row of information (independent of what the response is). Any tips or direction would be appreciated…Thanks
@echo off
cls
echo PathPing test in progress...
for /F %%i in (iplist.txt) do pathping %%i >> result.txt
echo .
echo .
echo Result is ready.Thank you very much.
Please assist with a small Script
Moderator: DosItHelp
Re: Please assist with a small Script
Greetings Amirsd!
You posted this question on another forum and you have an answer there. Did that solution work for you?
Later.
You posted this question on another forum and you have an answer there. Did that solution work for you?
Later.
Re: Please assist with a small Script
I don't understand exactly what you need but as a test for a random ip, this what i get
so what you need is just the part before the waiting for the 250 seconds then just go for the next ip , is that right ?
Tracing route to host-xx.xxx.x.xxx.xxxxx.net [xx.xx7.x.xx]
over a maximum of 30 hops:
0 pc1 [xx.xx.xx.xx]
1 * http://www.xxxxxxx.net [xxxx.1.1.2]
2 xxxxxxxxxx.home [xxx.xx8.1.1]
3 xxxxxxx-xxxx-xx-xxx[xxx.121.xxx.49]
4 host-xxx.xxx.xxx.210.xxxxx.net [163.xxxx.xx7.210]
5 host-xxx.xxx.xxx.210.xxxxx.net [163.xxxx.xx7.210]
6 host-xxx.xxx.xxx.210.xxxxx.net [163.xxxx.xx7.210]
7 host-xxx.xxx.xxx.210.xxxxx.net [163.xxxx.xx7.210]
8 host-xxx.xxx.xxx.210.xxxxx.net [163.xxxx.xx7.210]
9 host-xxx.121.211.133.txxx.net [163.xxxx.xx7.210]
10 * * *
Computing statistics for 250 seconds...
so what you need is just the part before the waiting for the 250 seconds then just go for the next ip , is that right ?
Re: Please assist with a small Script
Thanks for the reply. Correct though there is a w (timeout feature) but it would wait for certain time (e.g 250 sec) before moving to the next IP. I would like it to move to the next IP right away if there is a delay of more then 10 - 15 sec...Thanks
Re: Please assist with a small Script
-p period - Wait period milliseconds between pings.
-w timeout - Wait timeout milliseconds for each reply.
When -p is specified, pings are sent individually to each intermediate hop. When -w is specified, multiple pings can be sent in parallel. It's therefore possible to choose a Timeout parameter that is less than the wait Period * Number of hops.
so i think "pathping -p 15000" this will work. Try this
(15000ms i.e 15 sec)
-w timeout - Wait timeout milliseconds for each reply.
When -p is specified, pings are sent individually to each intermediate hop. When -w is specified, multiple pings can be sent in parallel. It's therefore possible to choose a Timeout parameter that is less than the wait Period * Number of hops.
so i think "pathping -p 15000" this will work. Try this
(15000ms i.e 15 sec)