Jump to content

detecting flash/solid state media


TravisC
 Share

Recommended Posts

hi, i need to know if there is any way to detect if a drive is flash media or not. I know there is a removable or fixed thing but i assume that it will see external hard drives as removable also. i just need to be able to distinguish between hdds and solid state/flash drives

thanks for any help

Link to comment
Share on other sites

  • 2 weeks later...

Try the DriveGetDrive() and DriveGetType() Functions.

Alternatively, if you are familiar with WMI, you can use that to query drive info. *I Recommend*

$objWMIService = ObjGet("winmgmts:{impersonationLevel=impersonate}!\\localhost\root\cimv2")
$colItems = $objWMIService.ExecQuery("Select * from Win32_DiskDrive Where (InterfaceType like " & chr(34) & "%USB%" & chr(34) & ")")
For $objItem in $colItems
    msgbox(0,$objItem.Caption,$objItem.MediaType)
Next

http://msdn2.microsoft.com/en-us/library/a...132(VS.85).aspx

Edited by spudw2k
Link to comment
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
 Share

  • Recently Browsing   0 members

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