M
morbusg
I wonder what am I missing when trying to put together a script to
save me some typing.
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
fetch("computersystemproduct", "name")
The above yields: #<WIN32OLE:0x2b369cc>.name
If it isn't obvious, I'm trying to get the ComputerSystemProduct.Name
printed out via a helper method. I was expecting the model name of the
computer I'm running.
TIA
save me some typing.
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
fetch("computersystemproduct", "name")
The above yields: #<WIN32OLE:0x2b369cc>.name
If it isn't obvious, I'm trying to get the ComputerSystemProduct.Name
printed out via a helper method. I was expecting the model name of the
computer I'm running.
TIA