Windows Command Line Ping Sweep

A brutally basic ping sweep from Windows command to look for hosts on a subnet.

for /L %x in (1,1,254) do @ping -n 1 -w 25 192.168.0.%x | find bytes=

This will return hosts that respond to ping on your LAN, for example.


This is useful in a pinch. For hosts that don’t respond to ping, you can use arp to try to find them. What I would suggest is launching an elevated command prompt and issuing arp -d which deletes all arp entries. Then, run the ping sweep. After the sweep, save your results and then run arp -a and save those results to see if there are any gaps you can fill in.

Tip: If you want the results of your scan to be in your clipboard so you can copy/paste, use parenthesis surrounding the for and pipe (|) it to clip.

(for /L %x in (1,1,254) do @ping -n 1 -w 25 192.168.0.%x |find bytes=) | clip