Stupid question?

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
 
M

Matthias Tacke

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 ...
 
P

Paul R. Sadowski

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
 
V

vagabond

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
 
A

Al Dunbar [MS-MVP]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top