[quote=341445:@]https://msdn.microsoft.com/en-us/library/windows/desktop/aa365915(v=vs.85).aspx
Its a bit of a complicated structure, but thats the way to do it in code without using an external app.
But you’ll want:
getmac.exe
That’s existed since Winddows XP.
See https://technet.microsoft.com/en-gb/library/bb490913.aspx for more info including csv output 
Don’t forget though, that the first might not be the “main” connection.
Have fun :)[/quote]
I used GetMac as you said Julian when I ran into this tonight. I needed to get the wifi mac address from IoT boards without connecting the board to the network. This is what I did, if anyone comes up with a way to prevent the empty array elements on split let me know.
[code]Public Function GetMacs() as String()
Dim s as String
Dim strMacInfo() As String
Dim sh As New Shell
sh.Mode = 0
sh.Execute(“GetMac /nh /fo csv”)
s = sh.Result
s = ReplaceAll(s, “-”, “:”)
s = ReplaceLineEndings(s, “”)
strMacInfo = Split(s, chr(34))
for i as integer = strMacInfo.Ubound DownTo 0
if InStr(strMacInfo(i), “,”) > 0 then strMacInfo.Remove(i)
if InStr(strMacInfo(i), "") > 0 then strMacInfo.Remove(i)
if InStr(strMacInfo(i), “/”) > 0 then strMacInfo.Remove(i)
if InStr(strMacInfo(i), “not”) > 0 then strMacInfo.Remove(i)
if InStr(strMacInfo(i), “disconnected”) > 0 then strMacInfo.Remove(i)
next i
’ Would like to remove this step somehow…
for i as integer = strMacInfo.Ubound DownTo 0
if strMacInfo(i) = “” then strMacInfo.Remove(i)
next i
Return strMacInfo
End Function[/code]