Go to ...

RSS Feed

April 6, 2020

Digging into POWERCFG

There’s an awful lot going on behind the POWERCFG command. If you take a look at its Microsoft Docs entry — Powercfg command-line options — there’s a lot to see there. It not only deals with battery and power information, it also deals with sleep and wake behavior, hibernation, devices and more. There are at least 35 documented options there, plus another undocumented item -qh. This shows all attributes for the command on your particular system: my production desktop has 133, my Lenovo X380 Yoga has 135, and Jakub Jares system (documented in this story) has 137. Here’s what you see in PowerShell if you look at its non-hidden attributes on most PCs:

Digging into Powercfg.common-aliases

The 8-4-4-4-12 hex digit string to the left of each alias is a Windows Globally Unique Identifier (GUID).
That’s how Windows identifies things to itself internally.
[Click image for full-sized view.]

I count 37 attributes that show up in the non-hidden view. That’s somewhere around 100 less than the total number of attributes actually known and often available to POWERCFG. You’ll occasionally make use of some of those other attributes to turn hibernation on or off (powercfg -h on or powercfg -h off). If you check the afore-linked MS DOCS entry, you’ll also see that hibernation files can be set to a specific size or to a reduced file type. Again, there’s a lot more going on here than I had any idea about until I started digging in. I’d suggest you think about doing likewise if sleep and wake or device power management should ever become an issue on one or more of your Windows 10 systems.

A Quick List of Useful Powercfg Commands

Assume each command that follows runs in an administrative PowerShell or command line (cmd.exe) session,  and starts with the command name itself — namely powercfg

Lists all power schemes defined on the current PC
Shows contents of a power scheme if supplied, all power schemes if empty
Shows aliases and their corresponding GUIDs
Shows all sleep states available to the current PC (also works as /A, as shown in article head)
Identifies device or process that most recently woke the system from sleep
Lists all active wake timers on the current PC
Generates a diagnostic system power transition report documenting most recent wake-up
Generates a diagnostic system power transition report

There’s an awful lot of interesting stuff going on, best served by spending some time exploring what the powercfg command is and can do. Much of what you can do with the Power Options widget in Control Panel also works through powercfg attributes. And there’s more . . . It’s worth digging into and learning more about, at any rate.

Author: Ed Tittel

Ed Tittel is a 30-plus-year computer industry veteran. He’s a Princeton and multiple University of Texas graduate who’s worked in IT since 1981 when he started his first programming job. Over the past three decades he’s also worked as a manager, technical evangelist, consultant, trainer, and an expert witness. See his professional bio for all the details.

Leave a Reply

More Stories From Admin Tools