How to get MAC address from command line / batch file in Vista?

  • Thread starter Thread starter Dave R.
  • Start date Start date
i use getmac command only bu it display some garbage with it , i want to get exactlymac address not long numbers like device tcp ip bla bla bla i want show the user only the mac address which is 12 digits at middle of the screen

for example your mac addreess is 01-10-10-10-10-11
 
I know this is an old post, but thanks for this info. I had a predicament of having multiple "Local Area Connection" types listed (i.e. Local Area Connection, Local Area Connection 2, etc), so I had to modify this a bit.

What's more, I tried "Intel" for the findstr argument and it still was outputting two MAC addresses (due to one Intel wi-fi adapter and the Intel 82579LM Gigabit Ethernet adapter). The solution for this was to limit it to the model number of the Intel Gigabit Ethernet adapter (82579LM) in the findstr argument, like this:

for /f "tokens=3 delims=," %%a in ('"getmac /v /fo csv | findstr 82579LM"') do echo MAC Address: %%a

This outputs the one MAC address for the proper Local Area Connection that uses the Intel 82579LM Gigabit Ethernet adapter.

Hope this helps someone a bit more at least.
 
Back
Top