1. 程式人生 > >如何檢視區域網內所有的IP

如何檢視區域網內所有的IP

@echo off
net view | find "\\">computername.txt
for /f "delims=\ " %%a in (computername.txt) do (
ping -n 1 %%a -4|findstr /i "TTL" >nul&&call :loop "%%a"
)>>所有線上的IP地址.txt
del computername.txt
pause&exit
:loop
for /f "tokens=2 delims=[]" %%b in ('ping -n 1 %~1 -4^|findst