Jump to content
Sign in to follow this  

Finding a empty drive ie Card Reader

Recommended Posts


I was using this for hard drives to get some info


Func _HardDrives()
Local $sResult, $objWMIService, $colItems
Local $strcomputer = "."
$objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\" & $strcomputer & "\root\cimv2")
$colItems = $objWMIService.ExecQuery("Select * from Win32_DiskDrive")
For $objItem In $colItems
  $sResult &= $objItem.Caption & @TAB & "Size: " & Int($objItem.Size / 1024 ^ 3) & " GB" & @LF
Return $sResult
EndFunc   ;==>_HardDrives

And i noticed that on one machine that had a card reader slot it returned this

Generic-Multi-Card uSB Device Size: 0GB

Is there a way to make it only return that device or maybe only return the 0 GB devices which should be the card reader?

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this