From: Jeff Barczewski Date: 2007-07-04T00:53:53+09:00 Subject: Re: mac addr determination ------=_Part_102784_23559453.1183478029089 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline On 7/3/07, ara.t.howard wrote: > > > can someone run this on windows and let me know if it works? > > def mac_address > return @mac_address if defined? @mac_address > re = %r/[^:\-](?:[0-9A-Za-z][0-9A-Za-z][:\-]){5}[0-9A-Za-z] > [0-9A-Za-z][^:\-]/o > lines = > begin > IO.popen('ifconfig'){|fd| fd.readlines} > rescue > IO.popen('ipconfig /all'){|fd| fd.readlines} > end > candidates = lines.select{|line| line =~ re} > @mac_address = candidates.first[re].strip > end > > > thanks! Works on windows xp! ------=_Part_102784_23559453.1183478029089--