Solved

batch file to constantly ping

Posted on 2014-04-18
4
491 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
profile migration 14 39
Missing Restore Points on Windows 7 9 84
CPU at 100% usage, why? 27 80
set url:tel to a website 3 13
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
While working, an annoying popup showing below will come and we cannot cancel or close it form the screen. The error message will come again and again.
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

867 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

12 Experts available now in Live!

Get 1:1 Help Now