The POWERCFG command prompt utility is designed to control power settings at the Windows command line in accordance with the ACPI specification.
Basic conditions of the program environment and equipment
ACPI (Advanced Configuration and Power Interface) is an open industry standard, first released in December 1996 and developed jointly by HP, Intel, Microsoft, Phoenix, and Toshiba, that defines a common interface for software power management. In other words, the ACPI standard defines the power management capabilities of computer hardware by operating systems.
According to the ACPI specification, there are the following basic states of the system’s software environment and hardware, denoted as Gn, the global state, and Sn, the sleep state:
G0 (S0) (Working – normal operation).
G1 (Suspend, Sleeping, Sleeping Legacy) – the machine is turned off, but the current system context is preserved and operation can continue without rebooting. For each device, the “degree of information loss” during the process of falling asleep is defined, as well as where the information should be stored and from where it will be read when waking up, and the time to wake up from one state to another (e.g., from sleep to working state). The power consumption level and the depth of the sleep state Sn are defined as follows:
S1-state in which all processor caches are reset and the processors have stopped executing instructions. However, power to the processors and RAM is maintained; devices that have not indicated that they should remain powered on can be turned off. Least power saving and fastest transition to the operational state;
S2 is a deeper sleep state than S1 when the CPU is disabled, usually in practice, not used;
S3 (“Suspend to RAM” (STR) in BIOS, “Standby” in versions prior to Windows XP and in some Linux distributions, and “Sleep” in Windows Vista and Mac OS X, although the ACPI specifications only refer to S3 and Sleep).
In the S3 state, the RAM (RAM) continues to be powered on and remains virtually the only component that consumes power. Since the state of the operating system and all applications, open documents, etc. are stored in RAM, the user can resume work exactly where they left it-the state of RAM when returning from S3 is the same as it was before entering this mode. (The spec says that S3 is quite similar to S2, only slightly more components are disabled in S3.)
S3 has two advantages over S4: the computer returns to a working state faster, and second, if the running program (open documents, etc.) contains sensitive information, this information will not be forced to disk. However, disk caches can be reset to disk to prevent data corruption in case the system fails to wake up, e.g. due to a power failure;
S4 (“Hibernation” in Windows, “Safe Sleep” in Mac OS X, also known as “Suspend to disk”, although the ACPI specification only mentions the term S4) – in this state all RAM contents are stored in non-volatile memory such as the hard disk: the state of the operating system, all applications, open documents, etc.
This means that after returning from S4, the user can resume from where he or she left off, similar to S3 mode. The difference between S4 and S3, other than the additional time to move the contents of RAM to disk and back, is that a power failure of the computer in S3 will result in the loss of all data in RAM, including all unsaved documents, while the computer in S4 is not affected.
S4 is quite different from the other S states and more closely resembles S1-S3 than G2 Soft Off and G3 Mechanical Off. A system in S4 can also be put into G3 Mechanical Off and still be S4, retaining state information so that the state of the operating system and all applications can be restored after power is applied.
In practice, S4 is the primary sleep mode for laptops, transitioning to it when the lid is closed.
G2 (or sleep state S5, soft-off) – soft (software) shutdown; the system is completely stopped and shut down, but some equipment is under standby power generated by the ATX standard power supply unit in the off ( but not de-energized) state.
The standby voltage from the +5VStandby (+5VSB) output of the power supply unit is supplied to the part of the devices that can be used to power up the entire system when certain events occur, such as when a special Ethernet frame is received into the network adapter buffer or a certain combination of keys is pressed on the keyboard.
G3 (mechanical off) – mechanical shutdown of the system; the ATX power supply is disconnected from the input voltage (220V). It is not possible to turn on the power supply.
Power Configuration utility – powercf.exe
Windows family operating systems include a Power Configuration utility (powercf.exe) to manage power settings from the command prompt.
Powercfg.exe command line format: POWERCFG /COMMAND [ARGUMENTS].
To display a list of all commands, execute:
For details about the command and parameters, execute:
“POWERCFG /? <COMMAND>“.
In the command line parameters, you can use the – character instead of the / character.
GUID is a globally unique identifier. It is created by software, and the algorithm of its formation is built in such a way that each new generated identifier never coincides with another one existing in the given system. GUID is denoted as groups of hexadecimal digits separated by hyphens:
The use of GUIDs allows you to programmatically identify the essence of objects, regardless of their verbal description, so for example, balanced power mode will have a GUID equal to 381b4222-f694-41f0-9685-ff5bb260df2e in any version of Windows, with any of its verbal names in any language.
In command line parameters, instead of GUID identifiers, you can use their aliases, the list of which is displayed when running the powercfg –aliases command. Accordingly, instead of GUID 381b4222-f694-41f0-9685-ff5bb260df2e you can use its alias – SCHEME_BALANCED.
Some of the powercfg command prompt parameters allow abbreviations. The following commands are identical:
powercfg -hibernate off
powercfg –h off
To change the power management settings, the command prompt must be run as administrator.
To display a list of the power management schemes that exist in this system, run the command:
An example of the information output:
To display the power modes and their support level on this computer, run the command:
The result depends on both hardware and Windows version. Example of displayed information:
To evaluate the computer’s power consumption configuration, run the command:
The result of this command is a report, which by default is saved as the energy-report.html file in the current directory. The report contains the results of analysis of device compliance with power management schemes, information about current configuration errors, compatibility issues with system software, supported sleep modes, and the processor’s power management capabilities.
To evaluate the power consumption configuration and output the result to a specified file with a test duration of 30 seconds, run the command:
powercfg /energy /duration 30 /output D:\\energy.html
For laptops, the report provides information on battery charge and battery life. If the batteries are nearing the end of their life, the report will inform you that the battery is not charging to its rated capacity and needs to be replaced.
To display the parameters of the currently active power management scheme, execute the command:
This command displays information about the values of individual parameters of the power management circuit and their GUIDs, which can be used in other commands to control and change the power saving settings.
To set the display shutdown timeout to 10 minutes on battery power, run the command:
powercfg /change -monitor-timeout-dc 10
To set the value to never turn off the display when the display is powered on, run the command:
powercfg /change -monitor-timeout-ac 0
To enable hibernation mode, run the command:
powercfg /hibernate on
To manage power from the graphical user environment, you can use the Power component of the Windows Control Panel.