tag:blogger.com,1999:blog-284600789737488130.post1874129904983347073..comments2024-02-07T02:22:20.642-05:00Comments on Ruby on Windows: Using Ruby & WMI to Detect a USB DriveDavid Mullethttp://www.blogger.com/profile/05597492688893461137noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-284600789737488130.post-61586112240869739472007-08-22T22:28:00.000-05:002007-08-22T22:28:00.000-05:00Hi, that was very useful, but is it possible to ge...Hi, that was very useful, but is it possible to get the drive the particular usb is associated? eg, if i have two usbs drives, how do i get the contents of each?<BR/><BR/>thanks and kind regards -botpAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-31770986213748706682007-07-02T01:16:00.000-05:002007-07-02T01:16:00.000-05:00Is there any way to actually get the mass storage ...Is there any way to actually get the mass storage insert EVENTS?<BR/><BR/>This method requires you to poll for mass storage devices every so often.<BR/><BR/>Another way to find removable devices is via the FileSystemObject;<BR/>require 'win32ole'<BR/><BR/>oFS = WIN32OLE.new("Scripting.FileSystemObject")<BR/>oDrives = oFS.Drives<BR/>oDrives.each() do |x|<BR/>#driveType 1 is removable disk<BR/> if x.DriveType == 1 && x.IsReady<BR/> #do something<BR/> end<BR/>end<BR/><BR/>this isn't ideal, but is another way to do a similar thing, depending on your application.<BR/><BR/>NickAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-284600789737488130.post-65604314509052642692007-06-13T05:46:00.000-05:002007-06-13T05:46:00.000-05:00Can you tell more about WMI? For example - how to ...Can you tell more about WMI? For example - how to use data from Perfomance Monitor (especialy on remote machine)Anonymousnoreply@blogger.com