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-08-12 04:17
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » Take a look at this code: how to display the MAC addresses of dual NICs View 848 Replies 2
Original Poster Posted 2010-07-07 23:15 ·  中国 江苏 苏州 电信
初级用户
Credits 57
Posts 32
Joined 2007-12-29 10:28
18-year member
UID 107098
Gender Male
Status Offline
@ECHO OFF
for /f "tokens=12" %%M in ('ipconfig/all ^| find /i "Physical Address"') do set MAC=%%M
ECHO %MAC%
PAUSE

If I have dual NICs, or even more, how can I display them~~? I don't know batch files very well /``~~ Please give me a hand~~ Thanks
Floor 2 Posted 2010-07-09 00:45 ·  中国 河北 廊坊 联通
中级用户
★★
Credits 499
Posts 225
Joined 2008-12-30 22:09
17-year member
UID 135392
Gender Male
Status Offline
@ECHO OFF
for /f "tokens=12" %%M in ('ipconfig/all ^| find /i "Physical Address"') do echo %%M
PAUSE
I deleted part of your code, and that more or less meets your requirement now, haha

[ Last edited by sl543001 on 2010-7-9 at 00:47 ]
SYBNQQ:354324773
Floor 3 Posted 2010-07-09 00:47 ·  中国 河北 廊坊 联通
中级用户
★★
Credits 499
Posts 225
Joined 2008-12-30 22:09
17-year member
UID 135392
Gender Male
Status Offline
The original code used set, so it could only display the information of the last NIC. If you remove it, it can display all the information.
SYBNQQ:354324773
Forum Jump: