DOS script which will ping once every 60 seconds

Hi,

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

Thanks.

REgards,

rAdny
randybanariaAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

sirbountyCommented:

:wait
ping 127.0.0.1 -n 60 > nul

:pingit
ping somehost.somewhere.com
goto wait
0
sirbountyCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
DhopeCommented:
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
CompTIA Security+

Learn the essential functions of CompTIA Security+, which establishes the core knowledge required of any cybersecurity role and leads professionals into intermediate-level cybersecurity jobs.

randybanariaAuthor Commented:
To Dhope,

i tried your solution but it stops eventually.
0
randybanariaAuthor Commented:
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
sirbountyCommented:
which is basically what I already posted...
0
randybanariaAuthor Commented:
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
HappyJackieCommented:
::Start
ping 127.0.0.1 -n 1
sleep 60000
goto start
0
HappyJackieCommented:
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
HappyJackieCommented:
ping -n 60 localhost

... wait's 60 seconds
0
sirbountyCommented:
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
sirbountyCommented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows Batch

From novice to tech pro — start learning today.