• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 540
  • Last Modified:

batch file to constantly ping

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
jackjohnson44
Asked:
jackjohnson44
  • 2
  • 2
2 Solutions
 
WORKS2011Austin Tech CompanyCommented:
echo off
ping -t ipaddress
0
 
KimputerCommented:
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
 
WORKS2011Austin Tech CompanyCommented:
For my own sake of understanding how does renaming the file make a difference?

Thank you
0
 
KimputerCommented:
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now