[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

batch file to constantly ping

Posted on 2014-04-18
4
Medium Priority
?
534 Views
Last Modified: 2014-04-19
Hi,
I restart a remote system pretty frequently and I need to know when it comes back online. To do this, I open a dos prompt and type in the command below.  It just pings the machine.  I have tried to put this in a .bat file, but it keeps opening several windows.  How can I make a file that I can double click to open a new dos prompt and keep pinging my machine?


ping v-mymachine /t
0
Comment
Question by:jackjohnson44
[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
  • 2
  • 2
4 Comments
 
LVL 17

Assisted Solution

by:WORKS2011
WORKS2011 earned 1000 total points
ID: 40009353
echo off
ping -t ipaddress
0
 
LVL 36

Accepted Solution

by:
Kimputer earned 1000 total points
ID: 40009355
It's because you named your batch file ping.bat (resulting in a loop).
Give it ANY other name, and should work as want.
0
 
LVL 17

Expert Comment

by:WORKS2011
ID: 40010692
For my own sake of understanding how does renaming the file make a difference?

Thank you
0
 
LVL 36

Expert Comment

by:Kimputer
ID: 40010752
He named the batch file ping.bat
Inside it calls the same batch file again. You think it will call the internal ping command, but the batch file named ping takes precedence and loop begins. Each time calling itself and keep opening more and more windows.
Calling the file anything else will actually start real ping command.
0

Featured Post

[Webinar] Lessons on Recovering from Petya

Skyport is working hard to help customers recover from recent attacks, like the Petya worm. This work has brought to light some important lessons. New malware attacks like this can take down your entire environment. Learn from others mistakes on how to prevent Petya like worms.

Question has a verified solution.

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

When asking a question in a forum or creating documentation, screenshots are vital tools that can convey a lot more information and save you and your reader a lot of time
Windows Server 2003 introduced persistent Volume Shadow Copies and made 2003 a must-do upgrade.  Since then, it's been a must-implement feature for all servers doing any kind of file sharing.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
In this video, viewers will be given step by step instructions on adjusting mouse, pointer and cursor visibility in Microsoft Windows 10. The video seeks to educate those who are struggling with the new Windows 10 Graphical User Interface. Change Cu…
Suggested Courses

649 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