Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm looking at the ping command help and i cant see a parameter to change the time between pings. I don't mean the timeout time.

(For example i want to send a ping every 5 seconds)

Is this possible?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

from a broadband forum:

Batch file

@echo off
:start
ping -n 1 <destination>
ping -n 5 127.0.0.1 > NUL 2>&1
GOTO start

or in a single command

for /L %i in (1,0,2) do @ping -n 1 <destination> & ping -n 5 127.0.0.1 > NUL 2>&1
share|improve this answer
    
ping -n 5 127.0.0.1 > NUL 2>&1 Whats this doing? –  tm1rbrt Jan 15 '10 at 12:56
    
> NUL redirects a program's output to the special file NUL, like /dev/null on Unix. And 2>&1 redirects stderr (all error messages) to the same place. –  grawity Jan 15 '10 at 13:17
    
In general, this is a way to make it wait: "5 pings" to your own computer, without displaying results, before coming back to the beginning and doing the ping your are interested in. –  Gnoupi Jan 15 '10 at 13:25
1  
tm1rbrt: If you're on Vista you can also use timeout if that feels less hacky :-) –  Joey Jan 15 '10 at 14:40
2  
Without thinking, I named the batch file 'ping.bat' and marvelled at the many windows created as it called itself. Does the trick - thanks! –  agtb Jul 21 '12 at 10:24

I don't think you can.

ping -t will send forever, but at the default rate.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.