From: djberg96@... (Daniel Berger) Date: 2004-06-29T05:47:56+09:00 Subject: Re: get same info as ipconfig? piir@earthlink.net (Todd Gardner) wrote in message news:<9b849915.0406280231.d91f103@posting.google.com>... > Hello Everyone, > > Is there a cross platform command to get the same info that ipconfig > [w2k] or ifconfig[POSIX] returns directly in Ruby? > > Thanks, > > Todd I see Sam mentioned sys-host (one of my packages), but it's not very useful at the moment. However, I plan to rewrite the Windows portion to use OLE + WMI. You can get the info you need on Windows like this: require "win32ole" ole = WIN32OLE.connect("winmgmts://") # Avoid non-working adapters by setting 'IPEnabled' to true query = "select * from Win32_NetworkAdapterConfiguration where IPEnabled = True" ole.ExecQuery(query).each{ |nic| p nic.IpAddress p nic.IpSubnet p nic.DefaultIPGateway } Regards, Dan