Hi
what a quick response. Thanks.
but I get the following error msg
the syntax of the command is incorrect.
for /f "tokens=3,4,5,6 delims=.: " %%b in ('ping -n 1 /a %%a^|find "TTL="')
greetings
s.
--- In
batchworld@..., foxidrive <foxidrive@...> wrote:
>
> On Tue, 21 Apr 2009 07:06:37 -0000, "SKARSATAI" <skarsatai@...>
> wrote:
>
> >Now I have the following quest to solve
> >
> >in the txt file there are three different ip ranges
> >11.129.xxx.xxx
> >11.113.xxx.xxx
> >11.145.xxx.xxx
> >
> >the computer.txt provides the ip adresses and names.
> >I would go for the pc names to ping.
> >what I need is a result in three txt files containing only the corresponding ips which where pingable.
> >result like:
> >129.txt should look like >> pcname1 11.129.001.001
> >113.txt
> >145.txt
>
> Just a little change from the other version:
>
> @echo off
> setlocal
> for /f "delims=" %%a in (computers.txt) do (
> for /f "tokens=3,4,5,6 delims=.: " %%b in ('ping -n 1 /a %%a^|find "TTL="')
> do (
> >>%%c.txt echo %%a %%b.%%c.%%d.%%e
> )
> )
>