回复 ygqiang
发给现场维护人员查看本机或用户MAC地址方便我们做运营商维护,话说,查看IP(IP、 ...
树怪熊 发表于 2015-1-20 16:00 - @ECHO OFF&Setlocal EnableDelayedExpansion
- set _Name=计算机名----&set _Domain=工作组------&set _IPAddress=IP地址------
- set _IPSubnet=子网掩码----&set _DefaultIPGateway=网关--------&set _DNSServerSearchOrder=DNS---------
- FOR /F "tokens=*" %%A IN ('WMIC Path Win32_ComputerSystem Get Domain^,Name /Value 2^>Nul') DO (
- FOR /F "tokens=*" %%i in ("%%A") do set %%i
- )
- FOR /F "tokens=*" %%A IN ('WMIC NICConfig WHERE "IPEnabled=TRUE" GET DefaultIPGateway^,Description^,DNSServerSearchOrder^,IPAddress^,IPSubnet /value 2^>Nul') DO (
- FOR /F "tokens=*" %%i in ("%%A") do set %%i
- )
-
- for %%i in (Name Domain IPAddress IPSubnet DefaultIPGateway DNSServerSearchOrder) do (
- set %%i=!%%i:{=!
- set %%i=!%%i:}=!
- set %%i=!%%i:"=!
- echo !_%%i!: !%%i:,= !
- )
-
- ping 127.0.0.1 -n 5 >nul 2>nul
- ECHO. Press any key to exit...
- PAUSE >Nul
- cls
- exit
复制代码
|