Y
Yu Haitao David
Hi,
I got my CPU load value of 100% whatever it really was in taskmgr.
I tried using "Win32_Processor.LoadPercentage" and
"Win32_PerfFormattedData_PerfOS_Processor_PercentProcessorTime", always
100%, while actually the load was below 20%.
But the script works normally under win2k.
My PC has winxp-sp1, and the script like the followings:
'=================================
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Processor",,48)
For Each objItem in colItems
WScript.Echo "LoadPercentage: " & objItem.LoadPercentage
Next
I got my CPU load value of 100% whatever it really was in taskmgr.
I tried using "Win32_Processor.LoadPercentage" and
"Win32_PerfFormattedData_PerfOS_Processor_PercentProcessorTime", always
100%, while actually the load was below 20%.
But the script works normally under win2k.
My PC has winxp-sp1, and the script like the followings:
'=================================
On Error Resume Next
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_Processor",,48)
For Each objItem in colItems
WScript.Echo "LoadPercentage: " & objItem.LoadPercentage
Next