Are there any OS capabilities in Windows to know your system's current power usage programmatically? (Ideal solution could be via WMI interface.)
Asked
Active
Viewed 4,010 times
6
-
There might be something in http://stackoverflow.com/questions/2450902/windows-cpu-power-management-apis – Mar 14 '12 at 22:47
-
2(This seems "like a real question" to me: How can the power consumption (or estimate thereof) be programmatically determined in Windows. If it is not possible, it still does not make it "not a real question", but just a question with a less-than-ideal answer.) – Mar 14 '12 at 22:47
-
Thanks, but it's too broad of a link. Any more specifics? – ahmd0 Mar 14 '12 at 22:48
-
1What? Is it a linguistics thread? Did I post in a wrong place? – ahmd0 Mar 14 '12 at 22:50
-
There is [Joulemeter](http://www.addictivetips.com/windows-tips/joulemeter-measures-power-consumption-of-the-system/) from Microsoft Research, but that isn't just an API and I don't know how it works. I *believe* it uses battery levels after stressing some particular hardware, and then uses that as a table to "determine power usage" later. It seems like -- even if not exposed in WMI -- modern motherboards would have a method of generally detecting CPU/chipset power consumption. Other systems like video cards with external power or drives are "off grid", however. – Mar 14 '12 at 22:53
2 Answers
6
Starting with Windows 7 you can use the Win32_PowerMeter
WMI class located in the root\CIMV2\power
namespace, this namespace has lot of another classes and events related to the power management and profiles.

RRUZ
- 134,889
- 20
- 356
- 483
-
That is a very interesting class, thanks! Although I'm somewhat confused over how to use it? – ahmd0 Mar 15 '12 at 01:27
-
-
Now, I can access it. What I mean is how do I get power usage stats off of it? – ahmd0 Mar 15 '12 at 01:40
-
1Try this open source project (http://code.google.com/p/pwrdrain-gadget/) which uses this class. – RRUZ Mar 15 '12 at 01:48
-
3
I don't know of anything on an instantaneous basis, but GetSystemPowerStatus
can give an estimate of remaining battery power. Calling that every few minutes (or something on that order) would give an idea of how quickly you're using power, at least as a percentage of the battery life. Of course, that really only works when/if there is a battery -- on a desktop or server system it normally won't produce anything useful.

Jerry Coffin
- 476,176
- 80
- 629
- 1,111
-
Yeah, that's an idea... although many systems may not have a battery (like my desktop now.) – ahmd0 Mar 15 '12 at 01:11