Stupid question?

  • Thread starter Thread starter vagabond
  • Start date Start date
V

vagabond

I create the simplest of batch files:

ping -n 2 <host>

but when I run it by double-clicking on it everything goes crazy.

If I run it from an already open command prompt it works fine.

Running it from a scheduled task results in it going crazy, too.

This is crazy (about four seconds' worth):

C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com ^
Terminate batch job (Y/N)? y
 
vagabond said:
I create the simplest of batch files:

ping -n 2 <host>

but when I run it by double-clicking on it everything goes crazy.

If I run it from an already open command prompt it works fine.

Running it from a scheduled task results in it going crazy, too.

This is crazy (about four seconds' worth):

C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com ^
Terminate batch job (Y/N)? y

Presumably the one who named the batch ping.bat or ping.cmd is crazy ?
This way you easily create an endless loop calling the batch which calls
the batch which calls ...
 
You didn't happen to name the file ping.cmd or ping.bat?

Rename it to MyPing and it should work just fine. Better still rename it
and change
ping -n 2 host
to
%WINDIR%\System32\ping.exe -n 2 host


I create the simplest of batch files:

ping -n 2 <host>

but when I run it by double-clicking on it everything goes crazy.

If I run it from an already open command prompt it works fine.

Running it from a scheduled task results in it going crazy, too.

This is crazy (about four seconds' worth):

C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com
C:\Documents and Settings\john.kelly\desktop>ping -n 2 www.google.com ^
Terminate batch job (Y/N)? y
 
Okay, that one was me, stupid me.


Matthias Tacke said:
Presumably the one who named the batch ping.bat or ping.cmd is crazy ?
This way you easily create an endless loop calling the batch which calls
the batch which calls ...

--
Greetings
Matthias________________________________________
For help on nt commands enter in a cmd window:
W2K>HH windows.chm::ntcmds.htm XP>HH ntcmds.chm
 
No, no, no. You were right the first time, it was a stupid question. We have
all made similar goofs, but it doesn't mean that we (or you) are, ourselves,
stupid. ;-)

/Al

Okay, that one was me, stupid me.
 
Back
Top