Sign in to follow this  
Followers 0
Chimaera

Finding a empty drive ie Card Reader

3 posts in this topic

I was using this for hard drives to get some info

Consolewrite(_HardDrives())

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
Next
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  
Followers 0