code_junkie

How do I run the following WMI query?

Nov 13th, 2011
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. SELECT * FROM Win32_USBControllerDevice
  2. For Each as USBDevice
  3. ASSOCIATORS OF {Win32_PnPEntity.DeviceID="<USBDevice.Dependent>"}
  4. WHERE ResultClass = Win32_DiskDrive
  5. For Each as Drive
  6. ASSOCIATORS OF {Win32_DiskDrive.DeviceID="<Drive.DeviceID>"}
  7. WHERE AssocClass = Win32_DiskDriveToDiskPartition
  8. For Each as Drive2Part
  9. ASSOCIATORS OF {Win32_DiskPartition.DeviceID="<Drive2Part.DeviceID>"}
  10. WHERE AssocClass = Win32_LogicalDiskToPartition
  11. For Each as Disk2Part
  12. Win32_LogicalDisk = <Disk2Part.Dependent>
  13. End For
  14. End For
  15. End For
  16. End For
Add Comment
Please, Sign In to add comment