Short VBS code - get a single specified instance of Win32_PerfRawData_PerfProc_FullImage_Costly class or get
a default unnamed instance (singleton) of the class, using one single command GetObject
with exact path of the wmi object.
Get a specified instance of Win32_PerfRawData_PerfProc_FullImage_Costly by a key, get a default unnamed instance (singleton) of the class or list instances of the class by wmi query using this c# sample code.
ManagementScope scope = new ManagementScope("\\\\.\\ROOT\\cimv2");
ObjectQuery query = new ObjectQuery("SELECT * FROM Win32_PerfRawData_PerfProc_FullImage_Costly Where Name=\"cscript/C:\\\\Windows\\\\SysWOW64\\\\cscript.exe\"");
ManagementObjectSearcher searcher =
new ManagementObjectSearcher(scope, query);
ManagementObjectCollection queryCollection = searcher.Get();
foreach (ManagementObject m in queryCollection)
{
Console.WriteLine("Timestamp_PerfTime : {0}", m["Timestamp_PerfTime"]);
}
Get a specified instance of Win32_PerfRawData_PerfProc_FullImage_Costly by a key, get a default unnamed instance (singleton) of the class or list instances of the class by wmi query using this VB.Net sample code.
Dim Scope As New ManagementScope("\\.\ROOT\cimv2")
Dim Query As New ObjectQuery("SELECT * FROM Win32_PerfRawData_PerfProc_FullImage_Costly Where Name="cscript/C:\\Windows\\SysWOW64\\cscript.exe"")
Dim Searcher As New ManagementObjectSearcher(Scope, Query)
Dim queryCollection As ManagementObjectCollection = Searcher.Get
For Each mObject As ManagementObject In queryCollection
Console.WriteLine("Timestamp_PerfTime : {0}", mObject("Timestamp_PerfTime"))
Next