中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

中国DOS联盟论坛
现在时间是 2026-06-25 01:48
中国DOS联盟论坛 » DOS媒体世界 & 网络技术 (多媒体室) » DOS下用指令找 Ethernet ID 查看 2,334 回复 2
楼 主 DOS下用指令找 Ethernet ID 发表于 2008-12-18 10:39 ·  中国 上海 浦东新区 电信
初级用户
积分 23
发帖 12
注册 2006-02-12 22:28
20年会员
UID 50257
状态 离线
請教各位,假如電腦裏面有藍牙,無線網卡,有線網卡.有沒有指令可以直接將有線網卡的ID抓出來.
例如, ipconfig /all 得到的資訊如下,我想把 00-1F-C6-45-2F-20 給抓出來.當然這個程式應該不僅僅針對這台電腦,對所有的電腦都應該能用.

我現在遇到的難題是機器有幾個ID且有關ID的那一行的關鍵字及格式都一樣,很難用find 指令達到目的.

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
2 发表于 2008-12-18 16:37 ·  中国 上海 浦东新区 电信
初级用户
积分 23
发帖 12
注册 2006-02-12 22:28
20年会员
UID 50257
状态 离线
我想到一個思路:

雖然 Physical Address.等關鍵字及格式不是唯一的,但上一行中Atheros L1 Gigabit Ethernet 10/100/1000Base-T 的關鍵字是唯一的. 有沒有指令找到上一行後,可以把下一行給列印出來?

Description . . . . . . . . . . . : Atheros L1 Gigabit Ethernet 10/100/1000Base-T Controller
Physical Address. . . . . . . . . : 00-1F-C6-45-2F-20
Dhcp Enabled. . . . . . . . . . . : Yes
Autoconfiguration Enabled . . . . : Yes
3 发表于 2008-12-18 17:08 ·  中国 广东 揭阳 电信
高级用户
★★
积分 774
发帖 293
注册 2003-04-16 00:00
23年会员
UID 1579
性别 男
来自 湖北仙桃
状态 离线
多看看批处理版块,这个问题很容易解决。我只会在那里找一些代码七拼八凑。
下载
09年7月7日 更新
感谢网友 囧HQY 提供空间
论坛跳转: