All pastes #168797 Raw Edit

ahFeel

public ruby v1 · immutable
·published 2006-09-13 10:06 UTC
rendered paste body
require 'win32ole'require 'socket'host = Socket.gethostnamecs = "winmgmts://#{host}/root/cimv2"begin	wmi = WIN32OLE.connect(cs)rescue WIN32OLERuntimeError => e	raise "Unsupported Windows Version."else	query = "select * from Win32_LogicalDisk"	hd = wmi.InstancesOf("Win32_OperatingSystem")	hd.each { |f| puts f.FreeSpace }end