Other wise, you could use a UNION query as follows:
Set fmtProcColItems = objWMIService.ExecQuery( _
"SELECT IDProcess, PercentProcessorTime, PrivateBytes, HandleCount, NULL AS Win32_PerfFormattedData_Pe
UNION
NULL AS IDProcess, NULL AS PercentProcessorTime, NULL AS PrivateBytes, NULL AS HandleCount, NumberBytesinallHeaps FROM Win32_PerfFormattedData_NE
"ANDWin32_PerfFormattedDat
Main Topics
Browse All Topics





by: fredtheredPosted on 2009-06-06 at 08:14:11ID: 24563261
If IDProcess is a field common to the data for both performance counters, then it should just be a matter of changing the SQL query to join both queries (assuming that IDProcess is (1) common to both; and (2) the unique identifying key for the data);
a_PerfProc _Process FROM Win32_PerfFormattedData_Pe rfProc_Pro cess AS WPP INNER JOIN Win32_PerfFormattedData_NE TFramework _NETCLRMem ory AS WNC ON WPP.IDProcess = WNC.IDProcess WHERE WPP.Name LIKE 'Vertical.Wave.ViewPoint%' " &_ ",,48)
e.g.
Set fmtProcColItems = objWMIService.ExecQuery( _
"SELECT WPP.IDProcess, WPP.PercentProcessorTime, WPP.PrivateBytes, WPP.HandleCount, WNC.Win32_PerfFormattedDat
"AND WNC.Name LIKE 'Vertical.Wave.ViewPoint%'