Please assist with a small Script

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
amirsd
Posts: 2
Joined: 18 Jan 2013 13:25

Please assist with a small Script

#1 Post by amirsd » 18 Jan 2013 13:34

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.

Ocalabob
Posts: 79
Joined: 24 Dec 2010 12:16
Location: Micanopy Florida

Re: Please assist with a small Script

#2 Post by Ocalabob » 18 Jan 2013 18:25

Greetings Amirsd!

You posted this question on another forum and you have an answer there. Did that solution work for you?
Later.

abc0502
Posts: 1007
Joined: 26 Oct 2011 22:38
Location: Egypt

Re: Please assist with a small Script

#3 Post by abc0502 » 19 Jan 2013 02:38

I don't understand exactly what you need but as a test for a random ip, this what i get
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 ?

amirsd
Posts: 2
Joined: 18 Jan 2013 13:25

Re: Please assist with a small Script

#4 Post by amirsd » 20 Jan 2013 22:37

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

shirulkar
Posts: 40
Joined: 15 Jan 2013 23:53

Re: Please assist with a small Script

#5 Post by shirulkar » 21 Jan 2013 09:21

-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)

Post Reply