Solved

DOS script which will ping once every 60 seconds

Posted on 2009-07-14
14
3,429 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
  • 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 500 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
 

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
DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Update a File not in all folders 2 43
How to copu batch file to a network location 62 77
bash script to unzip a file 5 45
xcopy loop 13 40
I have published numerous articles here at Experts Exchange that present programs/scripts written in a language called AutoHotkey. Each of those articles has a brief paragraph describing where to download the product and how to install it. I have al…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

910 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now