- @echo off
- for %%a in (
- Physical_Address
- IP_Address
- Subnet_Mask
- Default_Gateway
- DNS_Servers
- ) do set #%%a=#
-
-
- (for /f "tokens=1,2,* delims=.: " %%1 in ('ipconfig /all') do (
- if "%%1 %%2"=="Ethernet adapter" (
- set /a n += 1
- call echo [网卡%%n%%]
- for /f "delims=:" %%a in ("%%3") do echo %%1_%%2=%%a
- ) else (
- if defined #%%1_%%2 echo %%1_%%2=%%3
- if %%1 geq 0 if %%1 lss a echo DNS_Servers_2=%%1.%%2.%%3
- )
- ))>#网卡#.txt
-
- start #网卡#.txt
复制代码
|