Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi all,
I want to ping a machine in my LAN. If I run cmd and type
ping 192.168.0.1
it runs fine and I get replies.
If I put that exact command in a text file and call it pingtest.bat and then run the file, a shell opens and the command is run repeatedly, but never allowed to execute to completion; i.e. the shell just keeps scrolling and scrolling like this:
C:\ping 192.168.0.1
C:\ping 192.168.0.1
C:\ping 192.168.0.1
C:\ping 192.168.0.1
C:\ping 192.168.0.1
C:\ping 192.168.0.1
C:\ping 192.168.0.1
C:\ping 192.168.0.1
C:\ping 192.168.0.1
C:\ping 192.168.0.1
C:\ping 192.168.0.1
etc.....
and I need to close the shell or hit CTRL+C to stop it.
Anyone encountered this before and know a way around it?
Thanks,
Paul.

the command in the batch should just be ping [ip address]. Looks to me like you have a c:\ in front of it. Put the word exit at the end to close out the cmd window.

Hi Wanderer,
thanks for the reply. The C:\ bit was just meant to show what's displayed on the screen - I don't actually type that, I just run it from C:\.
The batch file contains only this line and nothing else:
ping 192.168.0.1
and I get the endless scrolling detailed above.

I have just tried that and it does the same thing for me.
I had a batch file called ping.bat and it has the following in it
ping google.com
pause
exitI don't know enough about DOS commands to know why this is happening?!
Shaun
Asus A7A266 266FSB
Athlon PX 1800+
512MB DDR266
60GB Deskstar

You've named your batchfile ping.bat, which looks for an executable PING in the path, starting in the folder it's run from, and of course, it finds ping.bat, and runs it, and so on. Call it something other than the command it runs.
narnar2000 has done something similar, I guess, perhaps he's got a previous attempt called ping.bat.

I don't believe it... I actually did have my file named "ping.bat", but I would swear I had tried other file names too...
Talk about a Windows 101 mistake.
Thanks for that, Rambler.

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |