The following code retrieves all USB hubs on a PC and adds them to a treeview:
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.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
Any help on this would be appreciated.
Computerman![]()





Reply With Quote