T
Toki Toki
Hi all!
I'm new to ruby, I've found this pretty neat code linked on a thread on
this forum, original post was at:
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/95197
require 'win32ole'
wmi = WIN32OLE.connect("winmgmts://./root/cimv2")
disk = wmi.ExecQuery("Select * from Win32_LogicalDisk")
disk.each {|drive| puts "#{drive.DeviceID} #{drive.FreeSpace}"}
Now, the code work very well, but I can't convert the free space in MB
or any other unit, how can I convert it?
Thanks.
Best regards.
I'm new to ruby, I've found this pretty neat code linked on a thread on
this forum, original post was at:
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/95197
require 'win32ole'
wmi = WIN32OLE.connect("winmgmts://./root/cimv2")
disk = wmi.ExecQuery("Select * from Win32_LogicalDisk")
disk.each {|drive| puts "#{drive.DeviceID} #{drive.FreeSpace}"}
Now, the code work very well, but I can't convert the free space in MB
or any other unit, how can I convert it?
Thanks.
Best regards.