![how to use usb device tree viewer how to use usb device tree viewer](https://www.drwindows.de/news/wp-content/uploads/2012/12/usb-device-tree-viewer_03.jpg)
USB Human Interface De... HidUsb USB\VID_045E&PID_00B9... > Ft -GroupBy Manufacturer Description,Service,DeviceID > Sort Manufacturer,Description,DeviceID | So that means that you can replace this script with the following one-liner (Note: I decided to sort and things to make it prettier ) If you have a WMIPath, you can get the object it points to just by casting it with. This script does a query to get all instances of WIN32_USBControllerDevice, then for each one it takes the DEPENDENT property and converts it to a query, it then executes that query (which gets the PNPEntities) and formats the description and deviceID. ‘of the Win32_USBControllerDevice collection. ‘as this script can be altered to return any property WScript.Echo objUSBDevice.PnPDeviceID ‘ Changed from Description to PnPDeviceID (“Select * From Win32_PnPEntity Where DeviceID = ‘” & strDeviceName & “‘”) Set colUSBDevices = objWMIService.ExecQuery _ StrDeviceName = Replace(strDeviceName, strQuotes, “”)ĪrrDeviceNames = Split(strDeviceName, “=”) (“Select * From Win32_USBControllerDevice”) Set colDevices = objWMIService.ExecQuery _ Set objWMIService = GetObject(“winmgmts:\\” & strComputer & “\root\cimv2”) That’s ok for now the point is that this class points to 2 other WMI entities.īelow is the VBScript that I got from here.
![how to use usb device tree viewer how to use usb device tree viewer](https://www.snapfiles.com/screenfiles/usbdevices.png)
The first thing you need to understand is that the WMI class WIN32_USBControllerDevice describes the connection between USB controllers (The Antecedent) and their logical devices (the Dependent). I rewrote it in PowerShell and was pretty happy with the results so I thought I would share them. Over on, I came upon a VBScript in a forum to find all the PNP entities associated with a USBController.