Ping all addresses in network, windows

前端 未结 11 1507
庸人自扰
庸人自扰 2021-01-30 00:14

Is it possible in windows cmd line to check all of the network addresses (with ping or similar) to see which ones are taken/ have active devices:

ie. something that does

11条回答
  •  鱼传尺愫
    2021-01-30 00:40

    Some things seem appeared to have changed in batch scripts on Windows 8, and the solution above by DGG now causes the Command Prompt to crash.

    The following solution worked for me:

    @echo off
    set /a n=0
    :repeat
    set /a n+=1
    echo 192.168.1.%n%
    ping -n 1 -w 500 192.168.1.%n% | FIND /i "Reply">>ipaddresses.txt
    if %n% lss 254 goto repeat
    type ipaddresses.txt
    

提交回复
热议问题