Professional Documents
Culture Documents
PowerCfg - The Hidden Energy and Battery Tool For Windows You're Not Using - Scott Hanselman
PowerCfg - The Hidden Energy and Battery Tool For Windows You're Not Using - Scott Hanselman
using
November 4, '13 Posted in Tools
Sponsored By
There's been a lot of talk about power and energy usage by PCs lately, especially ones on battery. I use an irresponsibly
power hungry desktop at home, an Ivy Bridge Intel Lenovo X1 Carbon Touch for work, a Surface 2 (for email, remote
desktop (RDP), videos, games and airplane stuff since I don't sweat its batter) and I'm also testing this prototype Haswell
that Intel sent me. Whatever machine I get next to replace the X1 Carbon Touch (likely a Yoga 2 Pro) will be a Haswell,
and ideally it will support "Connected Standby." Connected Standby is a low-power state that lasts for tens (or hundreds)
of hours, but allows the PC to play music, refresh email, and receive VOIP calls. Haswell is amazing, to be clear, but it's all
the components working together - chipset, wifi adapter, processor - that make for a truly compelling machine.
Recently I re-discovered the powercfg.exe command line tool that's built into Windows. You have this now. It's a funny
little tool that, on the one hand, lets you make minute tweaks to how power is used on your computer, but on the other
hand, creates the most elaborate reports on how your PC uses power.
You may have used powercfg.exe in low disk space situations to disable the hibernation file with
powercfg /hibernate off
It'll tell you lots of things about your system that you may not know, or that may help you better use power. For example
powercfg /availablesleepstates will tell you the flavors of sleep and standy your PC supports.
Standby (S2)
The system firmware does not support this standby state.
This is useful to know. My desktop supports standby. Do I use it? We'll see a little later. Here's the same query on my 5
years-newer Surface:
C:\>powercfg /a
The following sleep states are available on this system:
Standby (Connected)
These S1,S2,S3,S4 numbers indicate how "deeply" your system can sleep. S1 is dozing, and S4 is hibernation. You might
find that your machine supports a mode like S3 or something but then it's a device you've added that is preventing it
from sleeping that deeply. You can diagnose sleep issues (which, for me, usually end up being cheap USB things I've
added) with
powercfg /devicequery s1_supported
The most powerful (today) sleep state for energy management is Connected Standby also known as ACPI S0. Regular
Sleep/Standby on average Win7 and Win8 machines is S3.
Connected Standby lets you effectively turn your machine off, but still get email, VOIP calls, play music, etc. There's also
rules and guidelines around connected standby that limit battery drain to less than 5% of capacity over a work day.
I ran powercfg.exe /a on the prototype Haswell I've been evaluating and it too supports connected standby, which is
deeply cool. This explains the fantastic standby ("in the backpack") times I see with it. As more and more machines have
Haswell and support Connected Standby, developers will need to support theses "always fresh" scenarios. It's just habit
for me to open a laptop before getting on a plane, launch email, load up on RSS feeds, get my flight details. It'll be very
cool to have a Haswell machine in "Connected Standby" that is always fresh, even though it may have been asleep all
weekend.
Power Reporting
I recently blogged about how the Windows "High Performance" power profile differed from the "Balanced" profile on
Servers' performance. Since I'm not on my desktop machine 24/7, I could save a lot of energy by making sure it's falling
asleep at the appropriate time and that it's sleeping as deeply as possible.
The real magic switches buried in PowerCfg.exe are /energy and /batteryreport and, if your machine supports
"Connected Standby" also /sleepstudy, and I recommend you run them now. I shall wait. ;)
I ran the Energy Report on my Desktop and it generated a nice HTML report. Here's some highlights (it's super long).
Second, my wifi adapter isn't set to use Low-Power. Didn't know that.
Finally, my Wacom Tablet may have the wrong drivers or not be able to sleep:
This was extremely useful information for me, so I'll take 5 minutes and make sure this big desktop goes into standby
when I'm not around.
If you run powercfg /batteryreport on a laptop you get a WEALTH of information in an HTML report. Here's some
highlights.
NAME - X864048BA
MANUFACTURER - ATL
SERIAL NUMBER - 12412
CHEMISTRY - L/ION
DESIGN CAPACITY - 31,297 mWh
FULL CHARGE CAPACITY - 31,646 mWh
CYCLE COUNT - 34
What the device was doing, when, the battery mWh and times:
You get awesome charts showing how you battery discharges, charges, and percentages.
Connected Standby machines get an even MORE amazing report with /sleepstudy
You can see what apps are using what about of battery and time, what devices are the "worst offenders" and then you
can use this knowledge to decide what you keep running in the background.'
Here is one Connected Standby session:
I was a little surprised at the quantity of hard data collected and stored by Windows. Also, when blogs and reviewers do
detailed tests on different machines showing battery life and stressed tests, are they running powercfg.exe to ensure all
the drivers are working together and haven't been flagged as either power-hungry or energy-stupid?
I would love to see even more data on what Windows is doing around energy, and I'm nearly positive the system is
keeping track of power-hungry apps. Why not give me a little "heat map" in the title bar so I can know what browser
uses the most power, what app is working too hard, or what website is running JavaScript in a loop? Why not give us the
option to put those tools front and center?
Sponsor: Big thanks to Telerik Icenium for sponsoring the feed this week! Build and publish iOS & Android apps with
Visual Studio using only HTML5 & JavaScript! Telerik Icenium now includes Visual Studio integration. Start a 30 day trial
with support now!
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and
Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
Sponsored By
Hosting By
Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in
any way.