China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-25 03:28
中国DOS联盟论坛 » DOS媒体世界 & 网络技术 (多媒体室) » Find Ethernet ID using commands under DOS View 2,335 Replies 2
Original Poster Posted 2008-12-18 10:39 ·  中国 上海 浦东新区 电信
初级用户
Credits 23
Posts 12
Joined 2006-02-12 22:28
20-year member
UID 50257
Status Offline
Dear all, if there are Bluetooth, wireless network cards, and wired network cards in the computer. Is there a command that can directly capture the ID of the wired network card?

For example, the information obtained by ipconfig /all is as follows, and I want to capture 00-1F-C6-45-2F-20. Of course, this program should not only be for this computer, but should be usable for all computers.

Now the problem I encounter is that there are several IDs on the machine and the keyword and format of the line related to the ID are the same, so it is difficult to achieve the purpose with the find command.

Ethernet adapter 无线网络连接 3:
Media State . . . . . . . . . . . : Media disconnected
Description . . . . . . . . . . . : Intel(R) Wireless WiFi Link 4965AGN #2
Physical Address. . . . . . . . . : 00-1D-E0-56-22-53
Ethernet adapter 区域连接 7:
Description . . . . . . . . . . . : Atheros L1 Gigabit Ethernet 10/100/1000Base-T Controller
Physical Address. . . . . . . . . : 00-1F-C6-45-2F-20
Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
IP Address. . . . . . . . . . . . : 10.128.83.11
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 10.128.83.1
DHCP Server . . . . . . . . . . . : 172.28.128.8
DNS Servers . . . . . . . . . . . : 172.28.128.129
172.28.128.128
Primary WINS Server . . . . . . . : 172.28.128.129
Secondary WINS Server . . . . . . : 172.28.128.128
Lease Obtained. . . . . . . . . . : 2008年12月18日 上午 07:50:39
Lease Expires . . . . . . . . . . : 2008年12月21日 上午 07:50:39
Ethernet adapter 区域连接 8:
Media State . . . . . . . . . . . : Media disconnected
Description . . . . . . . . . . . : Bluetooth Personal Area Network
Physical Address. . . . . . . . . : 00-0E-A6-F3-56-9D
Floor 2 Posted 2008-12-18 16:37 ·  中国 上海 浦东新区 电信
初级用户
Credits 23
Posts 12
Joined 2006-02-12 22:28
20-year member
UID 50257
Status Offline
I have an idea:

Although the keywords and formats like Physical Address are not unique, the keyword in the previous line "Atheros L1 Gigabit Ethernet 10/100/1000Base-T" is unique. Is there a command to find the previous line and then print the next line?

Description . . . . . . . . . . . : Atheros L1 Gigabit Ethernet 10/100/1000Base-T Controller
Physical Address. . . . . . . . . : 00-1F-C6-45-2F-20
Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
Floor 3 Posted 2008-12-18 17:08 ·  中国 广东 揭阳 电信
高级用户
★★
Credits 774
Posts 293
Joined 2003-04-16 00:00
23-year member
UID 1579
Gender Male
From 湖北仙桃
Status Offline
Look more at the batch processing section, this problem is easy to solve. I just piece together some codes there.
下载
09年7月7日 更新
感谢网友 囧HQY 提供空间
Forum Jump: