Jump to content

Finding a empty drive ie Card Reader


Recommended Posts

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?
Link to comment
Share on other sites

  • 1 month later...

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...