# File lib/windows/sys/uname.rb, line 81 def self.version(host=Socket.gethostname) cs = "winmgmts://#{host}/root/cimv2" begin wmi = WIN32OLE.connect(cs) rescue WIN32OLERuntimeError => e raise Error, e else query = "select * from Win32_OperatingSystem" wmi.InstancesOf("Win32_OperatingSystem").each{ |ole| str = "#{ole.Version} #{ole.BuildNumber}-" str << "#{ole.ServicePackMajorVersion}" return str } end end