Hi Detlef.

--- In [email protected], "dleidinger" <[EMAIL PROTECTED]> wrote:
> i tried to run the script on my office-notebook, with an english XP 
> installed. But it doesn't work. I modifed the string-values like in 
> the script you firstly posted. 

The paths on english systems should be:
?"Processor(0)\% Processor Time" and
?"Processor(1)\% Processor Time"

You should get the path on your system with something like this:

local bSize, bName, cPath
bSize = 128
bName = "x".repeat(bSize)
dll.call("pdh.dll|PdhLookupPerfNameByIndexA|s! ui s ui*", "", 238,
"bName", "bSize")
cPath = bName
bSize = 128
bName = "x".repeat(bSize)
dll.call("pdh.dll|PdhLookupPerfNameByIndexA|s! ui s ui*", "", 6,
"bName", "bSize")
cPath ++= ?"(0)\" ++ bName
win.debug(cPath)

238 should be the index of "processor", 6 should be the index of
"processor-time %". The indices should be the same for all languages,
but I can only test on german systems here.

Did you check if the performance counter is enabled in registry?
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PerfOS\Performance:
Disable Performance Counters must be 0.

Mockey


Reply via email to