MsgBox (0, "", _GetMAC ())
Func _GetMAC($getmacindex = 1)
$ipHandle = Run(@ComSpec & ' /c ipconfig /all', '', @SW_HIDE, 2)
$read = ""
Do
$read &= StdoutRead($ipHandle)
Until @error
$read = StringStripWS($read,7)
$macdashed = StringRegExp( $read , '([0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2}-[0-9A-F]{2})', 3)
If Not IsArray($macdashed) Then Return 0
If $getmacindex < 1 Then Return 0
If $getmacindex > UBound($macdashed) Or $getmacindex = -1 Then $getmacindex = UBound($macdashed)
$macnosemicolon = StringReplace($macdashed[$getmacindex - 1], '-', ':', 0)
Return $macnosemicolon
EndFunc;==>_GetMAC