Solved

batch file to constantly ping

Posted on 2014-04-18
4
486 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
  • 2
  • 2
4 Comments
 
LVL 17

Assisted Solution

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

Accepted Solution

by:
Kimputer earned 250 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 35

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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

This is an article about Leadership and accepting and adapting to new challenges. It focuses mostly on upgrading to Windows 10.
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
This Micro Tutorial will give you a introduction in two parts how to utilize Windows Live Movie Maker to its maximum capability. This will be demonstrated using Windows Live Movie Maker on Windows 7 operating system.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

744 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

13 Experts available now in Live!

Get 1:1 Help Now