Solved

DOS script which will ping once every 60 seconds

Posted on 2009-07-14
12
960 Views
Last Modified: 2012-05-07
Hi,

I would need help to create one ping at the time for every 60 seconds.

Thanks.

REgards,

rAdny
0
Comment
Question by:randybanaria
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
  • 2
  • +2
12 Comments
 
LVL 7

Expert Comment

by:namol
ID: 24849134
Create a batch file with ping -n 1 targethere in it and then add it to the scheduler per the instructions on this page.
http://www.videohelp.com/forum/archive/need-to-run-a-vbsscript-every-60-seconds-t247224.html
0
 
LVL 5

Expert Comment

by:Dhope
ID: 24849212
Following should do it (save as a batch file)

:startagain
PING -n 1 machineName >>ping.log
TYPE NUL | CHOICE.COM /N /CY /TY,60 >NUL
goto startagain
0
 
LVL 70

Expert Comment

by:Qlemo
ID: 24849645
Or the traditional way:

:loop
ping -n 1 machine
ping -n 61 127.0.0.1 >nul 2>nul
goto loop

0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:randybanaria
ID: 24850132
I will try them.

let you know what's the result..

Thanks.
0
 

Author Comment

by:randybanaria
ID: 24850612
i should close this ticket becoz it's a redundant ticket.
0
 
LVL 8

Expert Comment

by:JT92677
ID: 24860413
This avoids pinging localhost over and over again

:loop
ping -n 1 -w 500 mit.edu
ping -n 1 -w 6000 noplace.tv
goto loop

ping the target 1 time, wait at most 5 seconds for a response
ping a non-existent site 1 time, waiting for 60 seconds (it won't respond)
loop back to beginning

Doesn't keep pinging localhost or using a file for junk output
0
 
LVL 70

Expert Comment

by:Qlemo
ID: 24861421
Pinging localhost is less bad then pinging into internet, or creating unnecessary DNS traffic. If using the "wait timeout" method, you should use a fixed, non-routed address which is not existing. That's causing ARP traffic only.
0
 
LVL 8

Accepted Solution

by:
JT92677 earned 500 total points
ID: 24862085
One ping in 60 seconds is hardly a DNS traffic issue given the enormous number of packets required to render a single webpage.

but if that is a great concern, he could issue a ping to an IP address in the network that does not resolve to any hardware.

This next set of commands pings my FTP server every 60 seconds using a non-existent IP for the 60 second wait interval

:loop
ping -n 1 -w 500 172.16.42.21
ping -n 1 -w 6000 172.16.42.254
goto loop

I can't get too excited about a ping every minute on the public nework, given the enormous volume of traffic required to render a single webpage.

0
 
LVL 70

Expert Comment

by:Qlemo
ID: 24863450
If it is for any use - ok. But totally senseless traffic should be avoided. And the "one ping per second to localhost" is no burden to the CPU or anything. Why not use it?
0
 
LVL 8

Expert Comment

by:JT92677
ID: 24864295
Apparently it is for a use although the direct benefit isn't obvious, the indirect benefit is that it solves the problem with virtually no impact on the network, regardless of how senseless it appears.

But in deference to your observation, I suggested an alternative to ping a local unused IP address on the local network. Or is that a problem too?

The objective is to solve the problem. Check out "suboptimal" and "suboptimization"

http://en.wiktionary.org/wiki/suboptimal
0
 
LVL 70

Expert Comment

by:Qlemo
ID: 24867398
"This avoids pinging localhost over and over again"
This implies that there are cons. There are none.

If you just wrote: "If you don't like pinging localhost every second ...", this would have been an alternative. Your proposal creates the imagination that it is better than all others. It is not.
I myself often present both solutions as coequal alternative ways. Choosing one of them is no matter of logic, but of preference.

In  reference to your reference: I don't know what you want to say with it. Didn't you see the last message  of original poster: "i should close this ticket becoz it's a redundant ticket."? This tells you it is not even suboptimal to further post here.
0
 
LVL 8

Expert Comment

by:JT92677
ID: 24871033
QLEMO: Since you seem to want to argue about my posts, let me address your concerns:

Pinging over and over again relies on the idea that each ping response takes a known amount of time, and that there won't be any accumulated error using multiple pings with unpredictable timing. This is simply wrong.

I would submit that a single ping with a 60 second timeout, to a non-existent IP address will run a single timer and produce a more accurate result, and that it is simpler to understand as well.

As is the case in many solutions, the simplest solution is often the best one, as anyone who understands the idea behind Occam's razor. I think my solution is simple and easy to understand, and it produces the expected results.

The author has not closed the ticket, perhaps this is why he used the term "should" instead of "will." Apparently the ticket is still open, or the author has lost interest. My crystal ball is not providing a clear answer to this question, maybe you know what's in the authors mind, I don't.

Your use of "not even suboptimal to further post here" -- is a bit confusing, and seems to indicate a misunderstanding of what is meant by suboptimal.

As to creating the imagination that a solution is better than another, I'll stick with the idea that simpler is better.

Since you have so many points (and have been an EE contributor for many years) you might simply clean up this question on your own. I am a new EE member, but that doesn't mean I'm new to solving computer problems. As a result, I don't have nearly as many points as you do, but you have a 5 year or more head start <<grin>>

As I see EE, we're here to provide suggestions, and alternatives. Points are a byproduct, not the purpose of a comment or solution.
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Include multiple hostnames in this command? 3 56
Question to Zip 8 96
robocopy 6 74
move command 5 68
VALIDATING DATES One method of validating dates is to jam the date into the DATE command and see if it accepts it by examining the system's errorlevel value. A non-zero result indicates failure. A typical example might look something like the fol…
Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question