中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-08-12 16:01
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS媒体世界 & 网络技术 (多媒体室) » Find Ethernet ID using commands under DOS
Printable Version  2,517 / 2
Floor1 shengping Posted 2008-12-18 10:39
初级用户 Posts 12 Credits 23
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
Floor2 shengping Posted 2008-12-18 16:37
初级用户 Posts 12 Credits 23
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
Floor3 xugaohui Posted 2008-12-18 17:08
高级用户 Posts 293 Credits 774 From 湖北仙桃
Look more at the batch processing section, this problem is easy to solve. I just piece together some codes there.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023