This took me long enough to do that I thought I'd share with the world.
I needed a MAC address from AutoIt code by parsing the output from "ipconfig /all" stdout stream.
It'll return the first MAC address it finds, and contains no error handling. Quick and dirty.
#include <constants.au3> $ipconfig = Run(@ComSpec & " /c " & 'ipconfig /all', "", @SW_HIDE, $STDOUT_CHILD) Local $line = "" While 1 $line &= StdoutRead($ipconfig) If @error Then ExitLoop WEnd $macraw = StringRegExp($line, "\s*Physical\sAddress[\s\.]*\:\s*((?:(\d{1,2}|[a-fA-F]{1,2}){2})(?::|-*)){6}", 2) $mac = StringRegExpReplace($macraw[0], "\s*Physical\sAddress[\s\.]*\:\s*", "")
Cheers,
RulerOf
P.S.: I hate regular expressions.








