# File lib/windows/sys/uname.rb, line 99 def self.sysname(host=Socket.gethostname) cs = "winmgmts:{impersonationLevel=impersonate,(security)}" cs << "//#{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| return ole.Caption } end end