Copy the following into a batch document that ends in bat and save
Convenient and practical
----------------------------------------------------------------------------------------
COLOR 0A
Cls
@ECHO OFF
Title Small FAI-hui query LAN online computer IP
: Send
@ECHO off&setlocal enabledelayedexpansion
ECHO small FAI LAN viewing tool
Ping 127.0.0.1>>/null
ECHO is getting the IP address of this machine, please wait a moment ...
for/f "tokens=3 skip=2 delims=:"%%i in (' Nbtstat-n ') do (
Set "Ip=%%i"
Set ip=! ip:~1,-1!
The ECHO native IP is:! Ip! You know
Goto:next
)
: Next
For/f "delims=. tokens=1,2,3,4 "%%i in ("%ip% ") do set Range=%%i.%%j.%%k
Echo.&echo is getting the other online computer name in this network section, please wait ...
The computers in the ECHO network segment "%range%.*" are:
for/f "delims="%%i in (' net View ') does (
Set "Var=%%i"
:: Query Online computer name
If "!var:~0,2!" =="\\" (
Set "var=!var:~2!"
ECHO!var!
Ping-n 1!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="%%i in (' Arp-a ') does ECHO IP:%%i in use
ECHO.
ECHO Query finished, press any key to exit ...
Pause>nul
-------------------------------------------------------------------------------------------
Copy the above into a batch document that ends in bat and save
This article originated from: http://sunjiehui.blog.51cto.com/
For more information, expect
This article is from the "Sun Jie" blog, make sure to keep this source http://sunjiehui.blog.51cto.com/10597502/1682763
Win all view scripts for LAN IP