Computer/Finding out network devices on Windows command prompt

From Mamin LAB
Jump to navigation Jump to search

Finding out network devices on Windows command prompt[edit | edit source]


Main_Page > Computer > Finding out network devices on Windows command prompt



Finding out network devices[edit | edit source]

for /L %i in (0,1,255) do ping -n 1 -w 200 192.168.1.%i

Result[edit | edit source]

Pinging 192.168.1.0 with 32 bytes of data:
Request timed out.

Ping statistics for 192.168.1.0:
    Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),

Pinging 192.168.1.1 with 32 bytes of data:
Reply from 192.168.1.1: bytes=32 time=4ms TTL=64

Ping statistics for 192.168.1.1:
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 4ms, Maximum = 4ms, Average = 4ms

Pinging 192.168.1.2 with 32 bytes of data:
Request timed out.

Ping statistics for 192.168.1.2:
    Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),

Pinging 192.168.1.3 with 32 bytes of data:
Request timed out.

Ping statistics for 192.168.1.3:
    Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),

Pinging 192.168.1.4 with 32 bytes of data:
Request timed out.

Ping statistics for 192.168.1.4:
    Packets: Sent = 1, Received = 0, Lost = 1 (100% loss),

Pinging 192.168.1.5 with 32 bytes of data:
Request timed out.


Finding out network devices with picking up existed devices[edit | edit source]

for /L %i in (0,1,255) do ping -n 1 -w 200 192.168.1.%i | findstr -m "(0%"

Result[edit | edit source]

C:\Users\mamin>for /L %i in (0,1,255) do ping -n 1 -w 200 192.168.1.%i | findstr -m "(0%"
 
ping -n 1 -w 200 192.168.1.0   | findstr -m "(0%"
 
ping -n 1 -w 200 192.168.1.1   | findstr -m "(0%"
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),

ping -n 1 -w 200 192.168.1.2   | findstr -m "(0%"

ping -n 1 -w 200 192.168.1.3   | findstr -m "(0%"

ping -n 1 -w 200 192.168.1.4   | findstr -m "(0%"

ping -n 1 -w 200 192.168.1.5   | findstr -m "(0%"

ping -n 1 -w 200 192.168.1.6   | findstr -m "(0%"

ping -n 1 -w 200 192.168.1.7   | findstr -m "(0%"

ping -n 1 -w 200 192.168.1.8   | findstr -m "(0%"
    Packets: Sent = 1, Received = 1, Lost = 0 (0% loss),

ping -n 1 -w 200 192.168.1.9   | findstr -m "(0%"

ping -n 1 -w 200 192.168.1.10   | findstr -m "(0%"

This means 192.168.1.1 and 192.168.1.8 have been used with some devices.


Finding out network devices with picking up existed devices and save it to a file[edit | edit source]

for /L %i in (0,1,255) do ping -n 1 -w 200 192.168.1.%i | findstr -m "bytes=32" >> ip_list.txt

Result in the file[edit | edit source]

Reply from 192.168.1.1: bytes=32 time=5ms TTL=64
Reply from 192.168.1.2: bytes=32 time=2ms TTL=64
Reply from 192.168.1.5: bytes=32 time=8ms TTL=64
Reply from 192.168.1.10: bytes=32 time<1ms TTL=128
Reply from 192.168.1.12: bytes=32 time=5ms TTL=64
Reply from 192.168.1.110: bytes=32 time=5ms TTL=128
Reply from 192.168.1.111: bytes=32 time=3ms TTL=128
Reply from 192.168.1.120: bytes=32 time=4ms TTL=128
Reply from 192.168.1.125: bytes=32 time=6ms TTL=128
Reply from 192.168.1.250: bytes=32 time=4ms TTL=64

You can easily find out the network devices.