Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

DOS script which will ping once every 60 seconds

Posted on 2009-07-14
14
Medium Priority
?
4,866 Views
Last Modified: 2012-06-27
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
  • 5
  • 3
  • 3
  • +1
14 Comments
 
LVL 67

Expert Comment

by:sirbounty
ID: 24849135

:wait
ping 127.0.0.1 -n 60 > nul

:pingit
ping somehost.somewhere.com
goto wait
0
 
LVL 67

Accepted Solution

by:
sirbounty earned 2000 total points
ID: 24849156
or if you have resource kit, you can use sleep (sleep 60)

or for a vbscript method:
Dim objShell : Set objShell = CreateObject("Wscript.Shell")
 
Sub pingit()
wscript.sleep 60000
objShell.Run "ping somehost.somewhere.com"
pingit
End Sub

Open in new window

0
 
LVL 5

Expert Comment

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

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

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:randybanaria
ID: 24850551
To Dhope,

i tried your solution but it stops eventually.
0
 

Author Comment

by:randybanaria
ID: 24850576
i tried this solution which i found from other site.

@echo off
cls
:start
echo ping every 40 seconds
ping -n 2 X.X.37.122
sleep 40
goto start

it does the job for me.
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 24850598
which is basically what I already posted...
0
 

Author Comment

by:randybanaria
ID: 24850599
this is the workaround for my previous question which i raised "cisco vpn client disconnects every 2 minutes". I'm looking for a permanent solution for vpn client disconnections.

0
 
LVL 1

Expert Comment

by:HappyJackie
ID: 24932105
::Start
ping 127.0.0.1 -n 1
sleep 60000
goto start
0
 
LVL 1

Expert Comment

by:HappyJackie
ID: 24932142
sorry previos comment was a little messed up....

Exactly how does it take before it stops pinging?
@echo off
cls
:start
ping -n 1 127.0.0.1
sleep 60000
goto start

Open in new window

0
 
LVL 1

Expert Comment

by:HappyJackie
ID: 24935968
ping -n 60 localhost

... wait's 60 seconds
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 26093547
I disagree - your posted 'solution' is basically a restatement of what I'd posted, in three different formats...
Your first response was a reply to an expert that posted after me - never acknowledging my attempts to help you, but then stating you'd resolved it with the same method described in my post...
0
 
LVL 67

Expert Comment

by:sirbounty
ID: 26096341
Based upon my suggestion of combining my first post with the sleep utility, coupled with the author's post that this is the solution they used, I say accept http:#24849156
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

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

When you receive another warning that your shared drive is almost full and you have asked your users to clean out old files again and again, here is a single command that may help. This command will place all the files that have not been used rec…
You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Please read the paragraph below before following the instructions in the video — there are important caveats in the paragraph that I did not mention in the video. If your PaperPort 12 or PaperPort 14 is failing to start, or crashing, or hanging, …
Suggested Courses

610 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