أخي محمد أيمن
تفضل ......
Dim objWMIService, objItem, colItems, strComputer, IDD
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" _
& strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_DiskDrive")
For Each objItem In colItems
If objItem.InterfaceType = "USB" Then
MsgBox "Computer: " & objItem.SystemName & vbCr & _
"Status: " & objItem.Status & vbCr & _
" ==================================" & vbCr & _
"Name: " & objItem.Name & vbCr & _
"Description: " & objItem.Description & vbCr & _
"Signature: " & objItem.Signature & vbCr & _
"Manufacturer: " & objItem.Manufacturer & vbCr & _
"Model: " & objItem.Model & vbCr & _
"Size: " & Int(objItem.Size / (1073741824)) & " GB" & vbCr & _
"Number of Partitions: " & objItem.Partitions & vbCr & _
"Total Cylinders: " & objItem.TotalCylinders & vbCr & _
"Tracks PerCylinder: " & objItem.TracksPerCylinder & vbCr & _
"Total Heads: " & objItem.TotalHeads & vbCr & _
"Total Sectors: " & objItem.TotalSectors & vbCr & _
"Bytes PerSector: " & objItem.BytesPerSector & vbCr & _
"Sectors PerTrack: " & objItem.SectorsPerTrack & vbCr & _
"Total Tracks: " & objItem.TotalTracks & vbCr & _
"Total SerialNumber: " & objItem.SerialNumber & vbCr & _
" -------- DeviceID Info ---------- " & vbCr & _
"PNPDeviceID: " & objItem.PNPDeviceID & vbCr & _
"InterfaceType: " & objItem.InterfaceType
End If
Next
والله من وراء القصد ... وهو حسبي
...........