Help fix PING batch file

June 25, 2009 at 06:36:00
Specs: Windows XP
I stole this code from another post, but how do I make it so that when I get a reply it DOES NOT write the IP to the batch file?

:start
@echo off
setLocal EnableDelayedExpansion

for /f "tokens=* delims= " %%a in (IPlist.txt) do (
echo %%a >> timedout.txt
ping %%a | find "Request timed out" >> timedout.txt
)


See More: Help fix PING batch file

Report •


#1
June 25, 2009 at 08:05:41
Do you mean you don't want the PING to display ?
If you want the PING to be hidden & do nothing.

You export it to nothing which is
> nul

For example.
Ping 127.0.0.1 -n 2 > nul

It will ping but it won't show or do anything else.
If thats not what your after give me some more information Please i'll do my best to help.

Matt

***************************
Need BatchFile Help ?
Msg me :)
***************************


Report •

#2
June 25, 2009 at 08:10:42
Sorry I didn't explain well. Right now the file rights all IP's to the output file. I just want the unresponsive IP's to only be written to the file. Specifically "Request timed out" Heres what tyhe output file now looks like:

XX.X26.110.46
Request timed out.
Request timed out.
Request timed out.
Request timed out.
XX.X23.58.240
XX.X26.45.4
Request timed out.
Request timed out.

The IP .58.240 is a good IP so how do I get that to NOT write to the file?


Report •

Related Solutions


Ask Question