Question : Ping from (192.168.1.1 - 192.168.1.254) without using IPlist.txt and output the result with Hostnames..

Hi,

I want to ping all computers in the range of (192.168.1.1 - 192.168.1.254) without using the "IPlist.txt".

When done; the output - I want to see is only the PCs that (0% loss) .. with the PC's Hostname.

Any PCs that "100% loss", I don't want to see.

Thanks

Here is the output, I want it looks like on the screen.

Hostnames are availables in your LAN:
192.168.1.1      --> MyPC1          Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),

192.168.1.254  --> MyPC254       Packets: Sent = 1, Received = 1, Lost = 1 (0% loss),

//////////////////////////////////////////////////////////////////////

@echo off

for /f %%p in (IPlist.txt) do (
   echo %%p
ping -n 1 -w 100 -a %%p |find /i "Packet"

)

//////////////////////////////////////////////////////////////////////

192.168.1.1
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
192.168.1.2
    Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),
...
...
...

192.168.1.254
    Packets: Sent = 1, Received = 1, Lost = 1 (0% loss),

Answer : Ping from (192.168.1.1 - 192.168.1.254) without using IPlist.txt and output the result with Hostnames..

Try this.
1:
2:
3:
4:
5:
6:
7:
@echo off

for /l %%p in (1,1,254) do (
   echo %%p
ping -n 1 -w 100 -a %%p |find /i "Packet"

)
Random Solutions  
 
programming4us programming4us