FOR /L %i IN (1,1,254) DO ping -n 1 192.168.10.%i | FIND /i "Reply">>c:\live_hosts.txt
- 1 says to ping just with 1 packet, 4 is default
- >> writes the results to live_hosts.txt
FOR /L %i IN (1,1,254) DO ping -a -n 1 192.168.10.%i | FIND /i "Reply">>c:\live_hosts.txt
- -a resolves ip to a hostname