COLOR 0acls@echo offtitle query online pc Ip:send@echo off in LAN&setlocal enabledelayedexpansion ECHO is getting the IP address of this machine, please wait a moment ... for/F"tokens=3 skip=2 delims=:"%%iinch('Nbtstat-n') Do (Set "ip=%%i"Setip=! ip:~1,-1!ECHO Native IP is:! Ip!Goto: Next): Next for/F"delims=. tokens=1,2,3,4"%%iinch("%ip%") Do Setrange=%%i.%%j.%%Kecho.&ECHO is getting other online computer names in this network section, please wait a moment ... ECHO This network segment "%range%.*"The computers Inside are: for/F"delims="%%iinch('net view') Do (Set "var=%%i":: Query online computer nameif "!var:~0,2!"=="\\" (Set "var=!var:~2!"ECHO!var!Ping-N1!var!>nul)) ECHO. ECHO is acquiring other online computer IPs in this network segment, please wait a moment ... for/F"skip=3 tokens=1,* delims="%%iinch('arp-a') DoECHO IP: PercentI am using ECHO. ECHO query complete, press any key to exit ... pause>nul
Querying online computer IP in LAN