This code snippet from devx shows a simple technique of passing multiple WMI requests into generic WMI processing code. By passing in different classes and parameters to a generic method, the code is easy to maintain and reuse. For example in the two separate calls to processMetrics the below example targets two different WMI classes. The code can be easily extended to map to any number of different WMI classes:

 Copy the declarations and code below and paste directly into your VB project.

Declarations:

Code:
 
Url