Powercfg

Last updated
powercfg
Developer(s) Microsoft
Initial release2004;20 years ago (2004)
Operating system Microsoft Windows
Type Command
License Proprietary commercial software
Website docs.microsoft.com/en-us/windows-hardware/design/device-experiences/powercfg-command-line-options

powercfg (executable name powercfg.exe) 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. [1] [2]

Contents

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 (with powercfg /devicedisablewake). 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 that its Windows Server Update Services be configured to install updates when workstations are available and Windows Task Scheduler can be set to wake the machine when needed.

Syntax

XP
POWERCFG [/LIST | /QUERY [name] | /CREATE name | /DELETE name | /SETACTIVE name | /CHANGE name settings | /HIBERNATE {ON|OFF} | /NUMERICAL int | /EXPORT name [/FILE filename] | /IMPORT name [/FILE filename] | /GLOBALPOWERFLAG {ON|OFF} /OPTION flag | /BATTERYALARM {LOW|CRITICAL} [settings] | /DEVICEQUERY flagquery | /DEVICEENABLEWAKE devicename | /DEVICEDISABLEWAKE devicename | /?]
Vista, Server 2008, 7
powercfg [/l[ist]] [/q[uery] [Scheme_GUID] [Sub_GUID]] ] [/x setting value] [/changename GUID name [scheme_description]] [/duplicatescheme GUID [DestinationGUID]] [/d[elete] GUID] [/deletesetting Sub_GUID Setting_GUID] [/s[etactive] Scheme_GUID] [/getactivescheme] [/setacvalueindex Scheme_GUID Sub_GUID Setting_GUID SettingIndex] [/setdcvalueindex Scheme_GUID Sub_GUID Setting_GUID SettingIndex] [/h[ibernate] [on|off]] [/a[vailablesleepstates]] [/devicequery query_flags] [/deviceenablewake devicename] [/devicedisablewake devicename] [/import filename [GUID]] [/export filename [GUID]] [/lastwake] [/aliases] [/setsecuritydescriptor [GUID|Action] SDDL] [/getsecuritydescriptor [GUID|Action]] [/requests] [/requestsoverride Caller_type Name Request] [/energy [/output filename] [/xml] [/duration seconds] [/trace [/d filepath]] [/waketimers] [/?]

Parameters

ParameterDescriptionOS
XPOther
/l[ist]Lists all power schemes in the current user's environment.YesYes
/q[uery] [scheme_name] (XP)
/q[uery] [Scheme_GUID] [Sub_GUID]
Displays the contents of the specified power scheme.
scheme_name
SCHEME_GUID
(Optional) Specifies the scheme_name/GUID of the power scheme to display. GUID can be obtained by using the powercfg /l command.
SUB_GUID(Optional) Specifies the GUID of the subgroup to display. Requires a SCHEME_GUID to be provided.
If neither SCHEME_GUID or SUB_GUID are provided, the settings of the current user's active power scheme are displayed.
If SUB_GUID is not specified, all settings in the specified power scheme are displayed.
YesYes
/c[reate] scheme_nameCreates a power scheme with the specified scheme_name.YesNo
/change settingvalue
/x settingvalue
Modifies a setting value in the current power scheme.
settingSpecifies one of the following settings:
monitor-timeout-ac minutes monitor-timeout-dc minutes disk-timeout-ac minutes disk-timeout-dc minutes standby-timeout-ac minutes standby-timeout-dc minutes hibernate-timeout-ac minutes hibernate-timeout-dc minutes processor-throttle-ac throttle processor-throttle-dc throttle
valueSpecifies the value in minutes.
  • AC settings are used when the system is on AC power. DC settings on battery power.
  • Setting any value to 0 will set the timeout=Never
  • throttle = NONE, CONSTANT, DEGRADE, or ADAPTIVE.
YesYes
/changename GUIDPowerSchemeName [scheme_description]Modifies the name of a power scheme and, optionally, the scheme description.
ValueDescription
GUIDSpecifies the GUID of the power scheme
nameSpecifies the name of the power scheme.
scheme_descriptionDescribes the power scheme.
If the description is omitted, then only the name will be changed.
NoYes
/duplicatescheme GUID [DestinationGUID]Duplicates the specified power scheme. The resulting GUID which represents the new scheme will be displayed.
ValueDescription
GUIDSpecifies a scheme GUID. Obtained by using the powercfg /l command.
DestinationGUIDSpecifies the GUID where the scheme will be copied.
If <DestinationGUID> is omitted, then a new GUID will be created for the duplicated scheme.
NoYes
/d[elete] scheme_name
/d[elete] GUID
Deletes the power scheme with the specified GUID.
scheme_name
GUID
Specifies the scheme_name/GUID of the scheme. GUID can be obtained by using the powercfg /l command.
YesYes
/deletesetting Sub_GUIDSetting_GUIDDeletes a power setting.
ValueDescription
Sub_GUIDSpecifies the subgroup GUID.
Setting_GUIDSpecifies the power setting GUID.
NoYes
/s[etactive] scheme_name
-s[etactive] Scheme_GUID
Makes the specified power scheme active on the computer.
scheme_name
Scheme_GUID
Specifies the scheme GUID.
YesYes
/getactiveschemeRetrieves the currently active power scheme.NoYes
/setacvalueindex Scheme_GUIDSub_GUIDSetting_GUIDSettingIndexSets a value associated with a specified power setting while the computer is powered by AC power.
ValueDescription
Scheme_GUIDSpecifies a power scheme GUID. Obtained by using the powercfg /l command.
Sub_GUIDSpecifies a subgroup of power setting GUID. Obtained by using the powercfg /q command.
Setting_GUIDSpecifies an individual power setting GUID. Obtained by using the powercfg /q command.
SettingIndex'Specifies which of the list of possible values this power setting will be set to.
Use the /l and /q options to discover the GUIDs
NoYes
/setdcvalueindex Scheme_GUIDSub_GUIDSetting_GUIDSettingIndexSets a value associated with a specified power setting while the computer is powered by DC power.
ValueDescription
Scheme_GUIDSpecifies a power scheme GUID. Obtained by using the powercfg /l command.
Sub_GUIDSpecifies a subgroup of power setting GUID. Obtained by using the powercfg /q command.
Setting_GUIDSpecifies an individual power settingGUID. Obtained by using the powercfg /q command.
SettingIndexSpecifies which of the list of possible values this power setting will be set to.
NoYes
/h[ibernate] [on|off]Enables or disables the hibernate feature. Hibernate timeout is not supported on all computers.YesYes
/n[umerical]Specify the power scheme to be operated upon with a numerical identifier.
This switch allows a number to be used in place of the scheme_name in the following commands: /QUERY, /DELETE, /SETACTIVE, /CHANGE, /EXPORT, and /IMPORT
YesNo
/g[lobalpowerflag] [on|off]]Turn one of the following global power flags on or off:
BatteryIconTurn the battery meter icon in the system tray on/off.
MultiBatteryTurns on/off multiple battery display in system Power Meter.
ResumePasswordPrompt for password on resuming the system.
WakeOnRingTurn on/off wake on ring support.
VideoDimTurn on/off support for dimming video display on battery power.
YesNo
/b[atteryalarm] [low|critical] [settings]Configure the battery alarm.
Settings:
/activate [on|off]Enable or disable the alarm.
/level [percentage (0100)]The alarm will be activated when the power level reaches this percentage.
/text [on|off]Turns the text notification on or off.
/sound [on|off]Turns the audible notification on or off.
/action [none|shutdown|hibernate|standby]Specifies the action to take when this alarm goes off. Not all actions are always available.
/forceaction [on|off]Force stand by or shutdown even if a program stops responding.
/program [on|off]Specifies a program to run. schtasks.exe /change may be used to configure the program.
YesNo
/a[vailablesleepstates]Reports the sleep states available on the computer. Attempts to report reasons why sleep states are unavailable.YesYes
/devicequery [query_flags]]Returns a list of devices that meet the specified flags:
wake_from_S1_supportedReturns all devices that support waking the computer from a light sleep state.
wake_from_S2_supportedReturns all devices that support waking the computer from a deeper sleep state.
wake_from_S3_supportedReturns all devices that support waking the computer from the deepest sleep state.
wake_from_anyReturns all devices that support waking the computer from any sleep state.
S1_supportedLists devices supporting light sleep.
S2_supportedLists devices supporting deeper sleep.
S3_supportedLists devices supporting deepest sleep.
S4_supportedLists devices supporting hibernation.
wake_programmableLists devices that are user/configurable to wake the computer from a sleep state.
wake_armedLists devices that are currently configured to wake the computer from any sleep state.
all_devicesReturns all devices present in the computer.
all_devices_verboseReturns a verbose list of devices.
YesYes
/deviceenablewake devicenameEnables the device to wake the computer from a sleep state.
devicenameSpecifies a device retrieved by using the powercfg /devicequery wake_programmable command.
YesYes
/devicedisablewake <devicename>Disables the device from waking the computer from a sleep state.
devicenameSpecifies a device retrieved by using the powercfg /devicequery wake_armed command.
YesYes
/import scheme_name [/FILE filename]
-import filename [GUID]
Imports all power settings from the specified file.
filenameSpecifies a fully qualified path to a file generated by using the powercfg /export command-line option.
GUID(optional) Represents the settings loaded into a power scheme. If not supplied, powercfg will generate and use a new GUID
YesYes
/export scheme_name [/FILE filename]
-export filename [GUID]
Exports a power scheme, represented by the specified GUID, to the specified file.
filenameSpecifies a fully qualified path to a destination file.
GUIDSpecifies a power scheme GUID. Obtained by using the /l command-line option.
YesYes
/lastwakeReports information about the event that woke the computer from the last sleep transition.NoYes
/aliasesDisplays all aliases and their corresponding GUIDs. The user may use these aliases in place of any GUID at the command promptNoYes
/setsecruitydescriptor [GUID|Action] SDDLSets a security descriptor associated with a specified power setting, power scheme, or action.
GUIDSpecifies a power scheme or a power setting GUID.
ActionSpecifies one of the following strings: ActionSetActive, ActionCreate, ActionDefault
SDDLSpecifies a valid security descriptor string in SDD format. Use powercfg /getsecuritydescriptor to see an example SDDL STRING.
NoYes
/getsecuritydescriptor [GUID|<Action>]Gets a security descriptor associated with a specified power setting, power scheme, or action.
GUIDSpecifies a power scheme or a power setting GUID.
<Action>Specifies one of the following strings: ActionSetActive, ActionCreate, ActionDefault
NoYes
/requestsEnumerate application and driver Power Requests. Power requests prevent the computer from automatically powering off the display or entering a low-power sleep mode.NoYes
/requestsoverride Caller_typeNameRequestSets a Power Request override for a particular Process, Service, or Driver. If no parameters are specified, this command displays the current list of Power Request Overrides. NOTE: No documentation exists to remove a request override entry once entered, however leaving off the request type will do so. powercfg -requestsoverride Caller_typeName (Request left blank to remove entry)
ValueDescription
Caller_typeSpecifies one of the following caller types: PROCESS, SERVICE, DRIVER. This is obtained by calling the powercfg /requests command.
NameSpecifies the caller name. This is the name returned from calling powercfg /requests command.
RequestSpecifies one or more of the following Power Request Types: Display, System, Awaymode *Leave blank to remove an entry.
NoYes
/energyAnalyzes the system for common energy-efficiency and battery life problems. The /energy command should be used when the computer is idle and with no open programs or documents. The /energy command will generate an HTML report file in the current path. Windows 7 and certain Windows 10 Insider builds only.
ValueDescription
/output filenameSpecifies the path and filename to store the energy report HTML file (default="energy-report.html").
/xmlFormats the report file as XML.
/traceRecords system behavior and does not perform analysis. Trace files will be generated in the current path unless the /d parameter is specified.
/d filepathSpecifies the directory to store trace data. May only be used with the /trace parameter.
/duration <seconds>Specifies the number of seconds to observe system behavior. Default is 60 seconds
No7 only
/waketimersEnumerates the active wake timers. If enabled, the expiration of a wake timer wakes the system from sleep and hibernate states.NoYes
/help
/?
Displays Help at the command prompt.YesYes
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 the users current power scheme)

For/f"tokens=2 delims=:("%%G in('powercfg -getActiveScheme')do(   powercfg -setAcValueIndex %%G sub_buttons sButtonAction 0   powercfg -setActive %%G )

Disable the sleep button (for all available power schemes)

For/f"skip=2 tokens=2,4 delims=:()"%%G in('powercfg -list')do(   powercfg -setAcValueIndex %%G sub_buttons sButtonAction 0   if"%%H"==" *" powercfg -setActive %%G )

See also

Related Research Articles

NTLDR is the boot loader for all releases of Windows NT operating system from 1993 with the release of Windows NT 3.1 up until Windows XP and Windows Server 2003. From Windows Vista onwards it was replaced by the BOOTMGR bootloader. NTLDR is typically run from the primary storage device, but it can also run from portable storage devices such as a CD-ROM, USB flash drive, or floppy disk. NTLDR can also load a non NT-based operating system given the appropriate boot sector in a file.

<span class="mw-page-title-main">File Explorer</span> File manager application that is included with releases of the Microsoft Windows operating system

File Explorer, previously known as Windows Explorer, is a file manager application and default desktop environment that is included with releases of the Microsoft Windows operating system from Windows 95 onwards. It provides a graphical user interface for accessing the file systems, as well as user interface elements such as the taskbar and desktop.

<span class="mw-page-title-main">Windows Registry</span> Database for Microsoft Windows

The Windows Registry is a hierarchical database that stores low-level settings for the Microsoft Windows operating system and for applications that opt to use the registry. The kernel, device drivers, services, Security Accounts Manager, and user interfaces can all use the registry. The registry also allows access to counters for profiling system performance.

<span class="mw-page-title-main">Group Policy</span> Feature of the Microsoft Windows NT family of operating systems

Group Policy is a feature of the Microsoft Windows NT family of operating systems that controls the working environment of user accounts and computer accounts. Group Policy provides centralized management and configuration of operating systems, applications, and users' settings in an Active Directory environment. A set of Group Policy configurations is called a Group Policy Object (GPO). A version of Group Policy called Local Group Policy allows Group Policy Object management without Active Directory on standalone computers.

cmd.exe Command prompt program

Command Prompt, also known as cmd.exe or cmd, is the default command-line interpreter for the OS/2, eComStation, ArcaOS, Microsoft Windows, and ReactOS operating systems. On Windows CE .NET 4.2, Windows CE 5.0 and Windows Embedded CE 6.0 it is referred to as the Command Processor Shell. Its implementations differ between operating systems, but the behavior and basic set of commands are consistent. cmd.exe is the counterpart of COMMAND.COM in DOS and Windows 9x systems, and analogous to the Unix shells used on Unix-like systems. The initial version of cmd.exe for Windows NT was developed by Therese Stowell. Windows CE 2.11 was the first embedded Windows release to support a console and a Windows CE version of cmd.exe. The ReactOS implementation of cmd.exe is derived from FreeCOM, the FreeDOS command line interpreter.

<span class="mw-page-title-main">Timeout (computing)</span> Elapsed time before a specified event is to take place

In telecommunications and related engineering, the term timeout or time-out has several meanings, including:

In computing, a file shortcut is a handle in a user interface that allows the user to find a file or resource located in a different directory or folder from the place where the shortcut is located. Similarly, an Internet shortcut allows the user to open a page, file or resource located at a remote Internet location or Web site.

Enhanced SpeedStep is a series of dynamic frequency scaling technologies built into some Intel microprocessors that allow the clock speed of the processor to be dynamically changed by software. This allows the processor to meet the instantaneous performance needs of the operation being performed, while minimizing power draw and heat generation. EIST was introduced in several Prescott 6 series in the first quarter of 2005, namely the Pentium 4 660. Intel Speed Shift Technology (SST) was introduced in Intel Skylake Processor.

System File Checker (SFC) is a utility in Microsoft Windows that allows users to scan for and restore corrupted Windows system files.

In computing, SUBST is a command on the DOS, IBM OS/2, Microsoft Windows and ReactOS operating systems used for substituting paths on physical and logical drives as virtual drives.

As the next version of Windows NT after Windows 2000, as well as the successor to Windows Me, Windows XP introduced many new features but it also removed some others.

Compared with previous versions of Microsoft Windows, features new to Windows Vista are very numerous, covering most aspects of the operating system, including additional management features, new aspects of security and safety, new I/O technologies, new networking features, and new technical features. Windows Vista also removed some others.

My Documents is the commonly recognized name of a special folder in Microsoft Windows This folder is supposed to be a personal area where users store their personal non-shared documents. However, many software developers have ignored this convention and as a result, this folder has become a dumping ground for the application data such as files containing settings and saved games. Users cannot delete, move or organize these files without causing unwanted behavior in their software.

<span class="mw-page-title-main">User Account Control</span> Security software

User Account Control (UAC) is a mandatory access control enforcement feature introduced with Microsoft's Windows Vista and Windows Server 2008 operating systems, with a more relaxed version also present in Windows 7, Windows Server 2008 R2, Windows 8, Windows Server 2012, Windows 8.1, Windows Server 2012 R2, Windows 10, and Windows 11. It aims to improve the security of Microsoft Windows by limiting application software to standard user privileges until an administrator authorises an increase or elevation. In this way, only applications trusted by the user may receive administrative privileges and malware are kept from compromising the operating system. In other words, a user account may have administrator privileges assigned to it, but applications that the user runs do not inherit those privileges unless they are approved beforehand or the user explicitly authorises it.

Windows XP visual styles are customizations of the graphical user interface of Windows XP. "Luna", "Royale", "Zune", and "Embedded" are codenames of the official visual styles designed for Windows XP by Microsoft. Since Windows XP, themes include the choice of visual styles as well. By default, "Luna" is preinstalled on Windows XP Home and Professional editions, "Royale" is preinstalled on Windows XP Media Center Edition and "Embedded" is preinstalled on Windows Embedded Standard 2009 and Windows Embedded POSReady 2009. In addition to the preinstalled visual styles, Microsoft has released additional ones for download. Third parties have also released visual styles, though these require modification of core Windows components to work. Visual styles are compatible with all Windows XP editions except Starter Edition.

<span class="mw-page-title-main">MSConfig</span> Microsoft Windows System Configuration

MSConfig is a system utility to troubleshoot the Microsoft Windows startup process. It can disable or re-enable software, device drivers and Windows services that run at startup, or change boot parameters.

In Microsoft Windows, cacls and its replacement, icacls, native command-line utilities capable of displaying and modifying the security descriptors on folders and files. An access-control list is a list of permissions for securable object, such as a file or folder, that controls who can access it. The cacls command is also available on ReactOS.

choice (command)

In computing, choice is a command that allows for batch files to prompt the user to select one item from a set of single-character choices. It is available in a number of operating system command-line shells.

Some of the new features included in Windows 7 are advancements in touch, speech and handwriting recognition, support for virtual hard disks, support for additional file formats, improved performance on multi-core processors, improved boot performance, and kernel improvements.

In computing, findstr is a command in the command-line interpreters (shells) of Microsoft Windows and ReactOS. It is used to search for a specific text string in computer files.

References

  1. "PowerCFG (Windows XP SP2/2003)". SS64.com. Archived from the original on 2017-03-04.
  2. "PowerCFG (Vista/Windows7/Server 2008)". SS64.com.

Further reading