Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need to understand "Ping" at command prompt

Status
Not open for further replies.

DougP

MIS
Dec 13, 1999
5,985
US
not sure if this is the right forum
anyway
I want to ping say yahoo.com and have each reply wait a minute and see if the Ip address changes between pings
Is this correct
Code:
ping -w 60000 -n 3 yahoo.com
I get a slight pause on the first ping but not a minute and the others come back faster. seems adding -w has no effect
Code:
C:\Documents and Settings\username>ping -w 60000 -n 3 yahoo.com

Pinging yahoo.com [209.131.36.159] with 32 bytes of data:

Reply from 209.131.36.159: bytes=32 time=152ms TTL=49
Reply from 209.131.36.159: bytes=32 time=215ms TTL=49
Reply from 209.131.36.159: bytes=32 time=167ms TTL=49

Ping statistics for 209.131.36.159:
    Packets: Sent = 3, Received = 3, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 152ms, Maximum = 215ms, Average = 178ms

any ideas

DougP
[r2d2] < I Built one
 
-w specifies the time to wait for a response, not the time between request

Maybe you should specify a little bit what you're trying to do

Cheers,
Dian
 
Some people use the Ping Command to pause a batch file for a period of time. Not strictly relevant to your post but it has an example of the Ping command.

WAIT

Maybe you could create your own batch file to Ping every 60 seconds? A sort of ping pause ping! All highly technical.
 
Just download connectionmonitor and have it do the work for you.

Stu..

Robert Wilensky:
We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the Internet, we know this is not true.

 
could you use

ping -t

this will ping and reply until you (ctrl+c) if you do (ctrl+break) if gives you stats..


ping -w = sets the time in milliseconds before the reply times out...
 
[1] Without specifying time to wait (-w), and with a proper ip address or locatable host name (disregard whether it is slow responding or otherwise), time to wait is default to around 5 second (-w 5000), if not specified.

[1.1] For instance a unresponsive host name like [ignore]www.abcxyz.com[/ignore], each time will be timeout for this command and it will time out around 5 second long (default).
[tt] ping -n 3 [ignore]www.abcxyz.com[/ignore][/tt]

[1.2] If you specify a longer or shorter time to wait, it takes effect for that kind of dead site. But, if a live site amid slow responding, the setting -w has only a partial bearing on how the ping would behave. If the responding time is lower than what -w sets, the lower wins out. (That's what is observed for yahoo.com with that long waiting time -w 60000.)

[2] For a sure-responding site (such as loopback 127.0.0.1 or localhost, most probably responding within the 5 sec default waiting), each n will be sent in one (1) second interval, that is what is alluding to in the synthetic sleep functionality, say a delay of 5 second would look something like this.
[tt] ping -n 6 127.0.0.1>nul[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top