中国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 03:21
47,811 topics / 349,897 posts / today 0 new / 48,256 members
DOS批处理 & 脚本技术(批处理室) » Take a look at this code: how to display the MAC addresses of dual NICs
Printable Version  846 / 2
Floor1 weihai6688 Posted 2010-07-07 23:15
初级用户 Posts 32 Credits 57
@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
Floor2 sl543001 Posted 2010-07-09 00:45
中级用户 Posts 225 Credits 499
@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 ]
Floor3 sl543001 Posted 2010-07-09 00:47
中级用户 Posts 225 Credits 499
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.
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023