Batch for "Ping"

Moogly_91 Posted messages 21 Status Membre -  
 Vassili -
Hello

I'm trying to create a batch file (on Windows XP) to perform a "ping" on a computer on my network.
When I run the file, the DOS window opens and the request is executed in an endless loop. What instructions should I add so that the batch runs normally as if it were in the command line?

Michel

8 réponses

Téka
 
Hello everyone,

I asked myself the same question as you Moogly_91, 6 years later... I created a file "ping.bat" containing a simple ping command (ping www.google.fr). And when I called my file: I type in the command prompt: "ping" and it loops without me being able to see a single result from the ping command.
The explanation I came up with, after some tests, is that since I can call my file "ping" just as well as "ping.bat", and since this file contains a call to the "ping" command, the file I created calls itself recursively. Hence the "loop" effect.
So I simply renamed my .bat file (to "pingu.bat" for example) and it works as intended :)

Best regards.
25
wes
 
OMG a big thank you, it's so stupid I did the same!
0
Vassili
 
Same in 2020 and still on XP, I made a ping.bat :p
0