Battery Status Counter Path contains a wildcard character \Battery Status(*)\Remaining Capacity
. You can use Browsing Performance Counters or Get-Counter to get path.
And As PdhAddEnglishCounter said in the Note, you can also use PdhAddCounter to add the localized counter path to the query.
How to use performance counters in different language environments?
Hi,
I encountered some errors when I use "PdhAddEnglishCounterA" or "PdhAddCounterA" in performance counters.
Everything is ok when I use "PdhAddCounterA" and correct English querying parameters in English environment. But after system language is changed to German, I got an error "Object not found" when I still use query parameters in English. And then, I tried to use "PdhAddEnglishCounterA" instead of "PdhAddCounterA". For most cases, this change could fix the issue and add counters successfully. However, for "Battery Status" counters, it's still failed to call "PdhAddEnglishCounterA".
How should I use these two APIs in different language environments? How to use English counters in other languages environments?
1 answer
Sort by: Most helpful
-
Xiaopo Yang - MSFT 12,726 Reputation points Microsoft Vendor
2022-11-07T07:56:06.48+00:00