[RESOLVED] Sorting Win32_USBHub Results
The following code retrieves all USB hubs on a PC and adds them to a treeview:
Code:
Dim USBHubsearcher As New ManagementObjectSearcher("SELECT * FROM Win32_USBHub")
For Each queryObj As ManagementObject In USBHubsearcher.Get()
SystemTree.Nodes(0).Nodes("USBHUB").Nodes.Add(queryObj("Description"), queryObj("Description"), 4, 4)
Next
What I want to do is to sort the results by "Description" so that they are listed in alphabetical order. ORDER BY does not work as it is not part of WQL.
Any help on this would be appreciated.
Computerman :)
Re: Sorting Win32_USBHub Results
I've never used treeview before, but it seems to have a Treeview.Sort() method. Did you try that?
Re: Sorting Win32_USBHub Results
OOPs. Forgot about treeview.sort.
Computerman :)