Configuring Power Management Settings Using the Powercfg Utility
Powercfg is a command-line utility for configuring Windows 7 power management policy. Powercfg.exe exposes all power management settings, including those that are not available in the UI or from Group Policy.
Power management settings are represented by GUIDs, so using Powercfg.exe generally requires that you know the GUIDs for the settings you want to modify. However, Powercfg. exe also supports aliases for most common GUIDs, and you can type powercfg -aliases to display a list of supported aliases as shown here (the output has been truncated).
C:\Windows\system32\>powercfg -aliases a1841308-3541-4fab-bc81-f71556f20b4a SCHEME_MAX 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c SCHEME_MIN 381b4222-f694-41f0-9685-ff5bb260df2e SCHEME_BALANCED fea3413e-7e05-4911-9a71-700331f1c294 SUB_NONE 238c9fa8-0aad-41ed-83f4-97be242c8f20 SUB_SLEEP 29f6c1db-86da-48c5-9fdb-f2b67b1f44da STANDBYIDLE 9d7815a6-7ee4-497e-8888-515a05f02364 HIBERNATEIDLE 94ac6d29-73ce-41a6-809f-6363ba21b47e HYBRIDSLEEP d4c1d4c8-d5cc-43d3-b83e-fc51215cb04d REMOTEFILESLEEP 7516b95f-f776-4464-8c53-06167f40cc99 SUB_VIDEO ...
For example, this means you can type powercfg -setactive SCHEME_BALANCED instead of having to specify the GUID for the Balanced power plan.
The examples that follow illustrate the use of Powercfg.exe on Windows Vista and later systems. You can run most of these commands while logged on as a standard user, but a few, such as -export (for exporting power plans) and -h (for enabling or disabling hibernation support), must be run from an administrator-level (elevated) command prompt.
Note To display detailed help for Powercfg.exe, type powercfg /? at a command prompt.
To list the available power plans (called power schemes) in Powercfg.exe:
C:\Windows\system32\>powercfg -L Existing Power Schemes (* Active) ----------------------------------- Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e (Balanced) Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c (High performance) * Power Scheme GUID: a1841308-3541-4fab-bc81-f71556f20b4a (Power saver)
Listing power schemes lets you determine the GUID for each scheme. The asterisk beside the High Performance scheme indicates that it is the active power plan. You can also determine the active power scheme quickly as follows.
C:\Windows\system32\>powercfg -getactivescheme Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c (High performance)
To display detailed information concerning the High Performance power scheme in the preceding example, see the code here (the output has been truncated).
C:\Windows\system32\>powercfg -q 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c (High performance) Subgroup GUID: fea3413e-7e05-4911-9a71-700331f1c294 (Settings belonging to no subgroup) Power Setting GUID: 0e796bdb-100d-47d6-a2d5-f7d2daa51f51 (Require a password on wakeup) Possible Setting Index: 000 Possible Setting Friendly Name: No Possible Setting Index: 001 Possible Setting Friendly Name: Yes Current AC Power Setting Index: 0x00000001 Current DC Power Setting Index: 0x00000001 Subgroup GUID: 0012ee47-9041-4b5d-9b77-535fba8b1442 (Hard disk) Power Setting GUID: 6738e2c4-e8a5-4a42-b16a-e040e769756e (Turn off hard disk after) Minimum Possible Setting: 0x00000000 Maximum Possible Setting: 0xffffffff Possible Settings increment: 0x00000001 Possible Settings units: Seconds Current AC Power Setting Index: 0x000004b0 Current DC Power Setting Index: 0x000004b0 Subgroup GUID: 0d7dbae2-4294-402a-ba8e-26777e8488cd (Desktop background settings) Power Setting GUID: 309dce9b-bef4-4119-9921-a851fb12f0f4 (Slide show) Possible Setting Index: 000 Possible Setting Friendly Name: Available Possible Setting Index: 001 Possible Setting Friendly Name: Paused Current AC Power Setting Index: 0x00000000 Current DC Power Setting Index: 0x00000000 Subgroup GUID: 19cbb8fa-5279-450e-9fac-8a3d5fedd0c1 (Wireless Adapter Settings) Power Setting GUID: 12bbebe6-58d6-4636-95bb-3217ef867c1a (Power Saving Mode) Possible Setting Index: 000 Possible Setting Friendly Name: Maximum Performance Possible Setting Index: 001 Possible Setting Friendly Name: Low Power Saving Possible Setting Index: 002 Possible Setting Friendly Name: Medium Power Saving Possible Setting Index: 003 Possible Setting Friendly Name: Maximum Power Saving Current AC Power Setting Index: 0x00000000 Current DC Power Setting Index: 0x00000000...
The following code changes the active power scheme to Balanced in the preceding example.
C:\Windows\system32\>powercfg -setactive SCHEME_BALANCED
Verify the result as follows.
C:\Windows\system32\>powercfg -L Existing Power Schemes (* Active) ----------------------------------- Power Scheme GUID: 381b4222-f694-41f0-9685-ff5bb260df2e (Balanced) * Power Scheme GUID: 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c (High performance) Power Scheme GUID: a1841308-3541-4fab-bc81-f71556f20b4a (Power saver)
The following code determines the available Sleep states supported by the system.
C:\Windows\system32\>powercfg -a The following sleep states are available on this system: Standby ( S1 S3 ) Hibernate Hybrid Sleep The following sleep states are not available on this system: Standby (S2) The system firmware does not support this standby state.
More Info For information concerning the differences between these different Sleep states, see http://msdn2.microsoft.com/en-gb/library/ms798270.aspx.
The following code displays the source that has awakened the system from sleep.
C:\Windows\system32\>powercfg -lastwake Wake History Count - 1 Wake History [0] Wake Source Count - 1 Wake Source [0] Type: Device Instance Path: ACPI\PNP0C0C\2&daba3ff&1 Friendly Name: Description: ACPI Power Button Manufacturer: (Standard system devices)
The following code changes the monitor time-out when running on AC power for the active power scheme to 30 minutes.
C:\Windows\system32\>powercfg -setacvalueindex SCHEME_CURRENT SUB_VIDEO VIDEOIDLE 1800 C:\Windows\system32\>powercfg -setactive SCHEME_CURRENT
The following code exports a power scheme to a .pow file (proprietary binary format).
C:\Windows\system32\>powercfg -export C:\newscheme.pow 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c
Use the -import switch to import a .pow file.
The following code disables hibernation on the computer.
C:\Windows\system32\>powercfg -h off
To evaluate the energy efficiency of the computer, first close all applications and documents, let the system remain idle for 10 minutes, and then run the following command.
C:\Windows\system32>powercfg -energy Enabling tracing for 60 seconds... Observing system behavior... Analyzing trace data... Analysis complete. Energy efficiency problems were found. 7 Errors 1 Warnings 11 Informational See C:\Windows\system32\energy-report.html for more details.
Opening the Hypertext Markup Language (HTML) file generated by the command displays a Power Efficiency Diagnostic Report with errors, warnings, and informational issues.
Configuring Power Management Settings Using the Power WMI Provider
Windows 7 now includes a WMI provider that lets you configure power policy through the standard WMI interface. Using this provider, you can script actions such as:
- Changing power setting values by using the Win32_PowerSetting class.
- Activating a specific power plan by using the Win32_Plan.Activate() method.
More Info See MSDN for more information on using WMI to manage power settings in Windows 7.
In this tutorial:
- Managing Devices and Services
- Understanding Device Installation and Management
- Device Enhancements in Windows 7
- Display Enhancements in Windows 7
- Understanding Device Installation
- Driver Store and Driver Packaging
- Driver Staging vs Installation
- Driver Staging and Installation Process
- Detailed Installation Process
- Managing Driver Packages
- Using PnPutil.exe
- Using Dism.exe
- Driver Signing
- Driver Ranking
- Installing and Using Devices
- Enhancements to the Device Installation Experience in Windows 7
- Scenario 1: Driver found in Driver Store
- Scenario 2: Driver found on Windows Update
- Scenario 3: Driver in Driver Store, But Better Driver on Windows Update
- Scenario 5: No Driver Can Be Found for the device
- Scenario 6: Vendor -supplied media is available
- Scenario 7: Additional Device Software is Available For Download from vendor
- Configuring Device Installation Settings
- Using the Devices And Printers Folder
- Understanding Device Stage
- Understanding the Device Experience Architecture
- Device Containers
- Device display object
- Device Metadata System
- Managing Device Installation Using Group Policy
- Managing Device Installation Behavior
- Managing Driver Installation Behavior
- Blocking Installation of Removable Devices
- Managing Device Redirection Behavior
- Troubleshooting Device Installation
- Using Windows Error Reporting
- Using the SetupAPI Log File
- Using Driver INF Files
- Using Device Manager Error Codes
- Using Driver Verifier
- Repairing Driver Store Corruption
- Repairing Index File Corruption
- Understanding Power Management
- Power Management Enhancements in Windows 7
- New Power Policies in Windows 7
- Configuring Power Management Settings
- Configuring Power Management Settings Using the Power Options Utility in Control Panel
- Configuring Power Management Settings Using Group Policy
- Configuring Power Management Settings Using the Powercfg Utility
- Understanding Services
- Service Enhancements in Windows 7
- Managing Services
- Managing Services Using Task Manager
- Managing Services Using the Sc.exe Command