lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Thu, Mar 18, 2010 at 2:53 PM, Enrico Colombini <> wrote:
> One thing to be aware is that the above strings change according to OS
> language; also there could be other (possibly virtual) network cards, so
> extracting the desired MAC address from the output of 'ipconfig /all' isn't
> always straightforward.

Yes, I forgot that Windows speaks other languages ;)

A rather easier command to parse is getmac

Physical Address    Transport Name
=================== ==========================================================
00-21-9B-6F-0F-19   \Device\Tcpip_{C0FF4EDB-2217-45F5-8814-08575CA97DC1}
00-50-56-C0-00-01   \Device\Tcpip_{09EEBB50-D557-4006-8CB0-AEFEC3E95623}
00-50-56-C0-00-08   \Device\Tcpip_{CA469F8A-22C1-4873-9BD4-EA4D1257B5C9}

But yes, it's not easy to distinguish the real interface from the
VMware interfaces...

The API route is .. tricky.  nixio may be the best cross-platform option.

steve d.