Error in Batch File "The process tried to write to a nonexistent pipe."

Every time I run the simple batch file below I get the following error :

The process tried to write to a nonexistent pipe.
..how can I solve this ?

@ECHO OFF
::pinger
PING www.google.com -n 1 | FIND "TTL=" >NUL
IF NOT ERRORLEVEL 1 GOTO Next
PING www.google.com -w 3000 | FIND "TTL=" >NUL
IF ERRORLEVEL 0 ECHO No Error pinging server
:Next
LVL 19
http:// thevpn.guruAsked:
Who is Participating?
 
SteveGTRConnect With a Mentor Commented:
I ran it on my home XP/Pro machine and it worked fine. The only thing I could see that might help is this reference:

http://support.microsoft.com/kb/135268
0
 
scrathcyboyConnect With a Mentor Commented:
eliminate the FIND TTL= statement and it will work in a batch file.  The batch expects the pipe to follow by output immediately.  YOu will find this works at the command line, it is simply an artifact of the DOS batch.
0
 
ShankadudeConnect With a Mentor Commented:
You can remove the FIND part, however PING doesn't always return an error level 0 when the server was pingable, for example if your router replies that it can't ping the destination network.

If you remove the >NUL you keep the function of the batchfile as it was supposed to be, it only output text if it finds the TTL in the ping output, but at least you're sure that it works.
0
 
SteveGTRCommented:
Your history of grading has eliminated me from helping you in the future.

I suggest you read the EE Guidelines...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.