From: Gordon Thiesfeld Date: 2007-08-09T06:09:59+09:00 Subject: Re: Win32ole WMI fetch > > require 'win32ole' > def fetch(where, what) > wmi = WIN32OLE.connect("winmgmts:{impersonationLevel=impersonate}!// > #{ARGV}") > qry = wmi.execquery("select * from win32_#{where}") > qry.each { |i| print "#{i}.#{what}" } > end You're using string interpolation, but that's not what's needed in this case. You actually need to call an ole method on an ole object. Try this: qry.each { |i| print i.send(what) } Or this: qry.each { |i| print i[what] }