Powercfg


powercfg is a command-line utility that is used from an elevated Windows Command Prompt to control all configurable power system settings, including hardware-specific configurations that are not configurable through the Control Panel, on a per-user basis. It was first introduced by Microsoft in Windows XP SP2 in 2004.

Usage

powercfg must be run from an elevated command prompt, and, under Windows XP, it requires workstation Administrator or power user rights. Power Schemes are configured on a per-user basis. The most common cause of problems with power saving and hibernation on Windows systems is an incompatible device driver. This can be diagnosed by disabling each device in turn. When activating power saving across a local area network, it is important to ensure that software updates, security patches and antivirus updates in particular, are not disrupted. Microsoft recommends to configure its Windows Server Update Services to install updates when workstations are available and Windows Task Scheduler can be set to wake the machine when needed.

Syntax

;XP
;Vista, 7

Parameters

;Power scheme GUIDs
The use of GUIDs avoids any problems with internationalisation when applying Power Saving to non-English versions of Windows. The three built-in power schemes have the aliases listed below, which can be used instead of the GUIDs:
The other GUIDs have aliases as well.

Examples

Lists all power schemes
powercfg /l

List all Aliases
powercfg -aliases

Retrieve the currently active power scheme
powercfg -getactivescheme

Set the Monitor and disc timeouts for the current Power saver scheme
powercfg -Change -monitor-timeout-ac 20
powercfg -Change -disk-timeout-ac 30

Enable the mouse to wake from sleep
powercfg -deviceEnableWake "Microsoft USB IntelliMouse Explorer"

Set the 'Power saver' scheme
powercfg -SETACTIVE SCHEME_MAX

Create a Custom Power scheme and set it as active Set _Custom_Power=B1234567-SS64-SS64-SS64-F00000111AAA
powercfg -DUPLICATESCHEME SCHEME_MAX %_Custom_Power%
powercfg -CHANGENAME %_Custom_Power% "SS64 Power Scheme "
powercfg -SETACTIVE %_Custom_Power%

Disable the sleep button For /f "tokens=2 delims=: do
Disable the sleep button For /f "skip=2 tokens=2,4 delims=:" %%G in do