Hey I am new to ruby and I do Windows administration. I have been playing with wmi and ruby, having a problem. This is not a problem with th wmi part but when I use get. I am asking for a computer name and then putting that information into the script. This does not work
This does
Can someone shed some light on this???
-How important does a person have to be before they are considered assassinated instead of just murdered?
-Need more cow bell!!!
Code:
require 'win32ole'
puts "what is the computer name that you want to use??? "
cpuName = gets
cpuName.chomp
mgmt = WIN32OLE.connect("winmgmts:\\\\#{cpuName}")
mgmt.InstancesOf("Win32_ComputerSystem") .each{ |item| puts item.name + "\n" + item.Manufacturer + " - " + item.Model}
mgmt.InstancesOf("Win32_SystemEnclosure").each{ |dev| puts dev.SerialNumber}
This does
Code:
require 'win32ole'
cpuName = 'aname'
mgmt = WIN32OLE.connect("winmgmts:\\\\#{cpuName}")
mgmt.InstancesOf("Win32_ComputerSystem") .each{ |item| puts item.name + "\n" + item.Manufacturer + " - " + item.Model}
mgmt.InstancesOf("Win32_SystemEnclosure").each{ |dev| puts dev.SerialNumber}
Can someone shed some light on this???
-How important does a person have to be before they are considered assassinated instead of just murdered?
-Need more cow bell!!!