局域网IP地址查询批处理

来源:互联网 发布:淘宝货到付款怎么收费 编辑:程序博客网 时间:2024/04/30 04:34

@echo off
cls
color 34
if exist temp.txt del temp.txt
@echo 局域网IP地址已分配情况:
for /L %%p in (1,1,255) Do ( ping.exe -n 1 -w 20 10.10.10.%%p > temp.txt
  for /f "tokens=1,2,3,4*" %%i in (temp.txt) do if "%%i"=="Reply"   echo The Address %%k is distributed
    
 )
pause

 

说明:使用时需要根据您当前局域网IP地址。更改 10.10.10.%%p。假如你的IP地址为192.168.3.26;则应该成192.168.3.%%p。