OK guys, this is not the usual easy to answer question the title may imply...
I need to get the MAC address from a machine running Windows (ranging from XP to Server2012). I have the following option that I can use:
1) getmac - Fine in general and also the format in which it returns the MAC address suits me, but it have caused me problems in the past.
2) WMIC - Also fine in general, but has also caused me issues in the
past and furthermore it is lagging in performance (especially on low
spec machines).
3) ipconfing - Traditional way of retrieving it from the commands output. Could work but parsing the output could be cumbersome if more that one interfaces exist.
So the question is the following. What is the best alternative to all of the above in order to get a machine's MAC address. Keep in mind that I'll be invoking whatever utility through a shell script (whatever this adds up to the equation) and that I'm deploying on several different Windows editions (ranging from Professional to POS embedded).
Powershell is obviously out of the question since it is not supported by XP. Also the reason why I would like to avoid WMIC is 1) the fact that I have came across may bad installation (causing major issues) and 2) because some Windows editions (XP embedded for example) do not include it.
I have tried getting it by using the ARP table, but as far as I have seen it'll not list the MAC address of the local machine.
Any useful hints or ideas are welcome.