View the computer names and IP addresses of other computers on the LAN.

Source: Internet
Author: User

View the computer names and IP addresses 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




How to find the name and IP address of a computer in the same LAN

You can use this command to determine

1: You and this computer are not in the same working group. You can check whether they are in that group: net view/domain is the working group that determines where they are located.

2: Use net view/domian: Working group name to view which computers are in the corresponding Working Group

3: ping the computer name to obtain its IP address.

4: Obtain the computer name of the nbtstat-a ip address.

It should be noted that all these command lines may fail if the firewall or computer browser is not enabled. Good luck!

How can I view ip addresses through computer names in a lan?

Sometimes we need to query all the computer IP addresses and computer names in the local area network, but many software with similar functions on the network is not safe, and it is difficult for people without relevant technologies to achieve this requirement, in this case, you can try the simple method described here without any software or other technologies.
Click "start" in the taskbar, select "All Programs", select "accessories", and select "Notepad" in the pop-up menu to open the Notepad program:

Copy the following content to notepad and save it as a batch file suffixed with. bat:
COLOR 0A
CLS
@ ECHO Off
Query IP addresses of online computers in a LAN
: Send
@ ECHO off & setlocal enabledelayedexpansion

ECHO is obtaining the IP address of the Local Machine. 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
)

: Next
For/f "delims =. tokens = 1, 2, 3, 4" % I in ("% IP %") do set range = % I. % j. % k
ECHO. & ECHO is obtaining the names of other online computers in this section. Please wait...
ECHO computers in [% range %. *] of this section include:
For/f "delims =" % I in ('net view') do (
Set "var = % I"
: Query the name of an online computer
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 in use

ECHO.
After the ECHO query is completed, press any key to exit...
Pause> nul

In the notepad window, click the "file" menu and select the "Save as..." command from the pop-up menu:

In "Save type", select "all files" and save "file name" as. bat files, such as "view LAN online IP address. bat", as shown in;
Open the saved "view LAN online IP address. bat" program and you can see the execution result:

In the preceding execution window, the names and IP addresses of all online computers in the local area network are displayed. In addition, the upper and lower parts correspond to the same computer at the same location;
Of course, if you can, you can also modify the BAT program as needed to query the MAC addresses of these corresponding IP addresses and share the opened IP addresses .... Remaining full text>

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.