@echo off
if exist ipconfig
txt del ipconfig
txt
ipconfig /all >ipconfig
txt
if exist phyaddr
txt del phyaddr
txt
find
Physical Address
ipconfig
txt >phyaddr
txt
for /f
skip=
tokens=
%%M in (phyaddr
txt) do set Mac=%%M
if exist IPAddr
txt del IPaddr
txt
find
IP Address
ipconfig
txt >IPAddr
txt
for /f
skip=
tokens=
%%I in (IPAddr
txt) do set IP=%%I
arp
s %IP% %Mac%
del ipaddr
txt
del ipconfig
txt
del phyaddr
txt
exit
From:http://tw.wingwit.com/Article/program/qrs/201401/30225.html