View the computer name and IP address of other computers on the LAN
1. Run the following script to view the computer name and IP address in the LAN, save the following text to notepad, and change the suffix to bat.
COLOR 0ACLS @ ECHO OffTitle: send @ ECHO off & setlocal enabledelayedexpansionECHO is obtaining the local IP address. Please wait... for/f "tokens = 3 skip = 2 delims =:" % I in ('nbtstat-n') do (set "IP = % I" set IP =! IP :~ 1,-1! ECHO local IP :! IP address! Goto: next): nextfor/f "delims =. tokens = 1, 2, 4 "% I in (" % IP % ") do set range = % I. % j. % kECHO. & ECHO is obtaining the names of other online computers in this section. Please wait... ECHO this section [% range %. *]: for/f "delims =" % I in ('net view') do (set "var = % I ":: query the online computer name if "! Var :~ 0, 2! "=" \ "(Set" var =! Var :~ 2! "ECHO! Var! Ping-n 1! Var!> Nul) ECHO. ECHO is obtaining the IP addresses of other online computers in this section. Please wait... for/f "skip = 3 tokens = 1, * delims =" % I in ('Arp-a') do echo ip: % I is using ECHO. after the ECHO query is completed, press any key to exit... pause> nul
2. You can also enter the nbtstat-a IP address in cmd to obtain the mac address, computer name, and Working Group of the corresponding IP address. Note: Disable the firewall and 360 security guard