Vous êtes sur la page 1sur 15

Powercfg Command-Line Options

TechNet United States (English)


Sign in


> Command-Line Tools Technical Reference
>
Powercfg Command-Line Options Any suggestions?

Powercfg Command-Line Options


You can use the Powercfg.exe tool to control power settings and configure computers to default to Hibernate or Standby modes.

The Powercfg.exe tool is installed with Windows.

Powercfg Command-Line Options


The following command-line options are available for Powercfg.

powercfg [-l] [-q ] [-x] [-changename] [-duplicatescheme] [-d] [-deletesetting] [-setactive] [-getactivescheme] [-
setacvalueindex] [-setdcvalueindex] [-h] [-a] [-devicequery] [-deviceenablewake] [-devicedisablewake] [-import] [-export] [-
lastwake] [-?] [-aliases] [-setsecuritydescriptor] [-getsecuritydescriptor]


Option
Description

- list Lists all power schemes in the current user's environment.

-l Example:

powercfg -list

- query [Scheme_GUID] [Sub_GUID] Displays the contents of the specified power scheme.

- q [Scheme_GUID] [Sub_GUID] Usage:

powercfg -query [Scheme_GUID] [Sub_GUID]

SCHEME_GUID

(Optional) Specifies the GUID of the power scheme to display. Can be obtained by
using the powercfg -l command.

SUB_GUID

(Optional) Specifies the GUID of the subgroup to display. Requires a



Was this SCHEME_GUID
page helpful?
to be provided.
Yes
No

https://technet.microsoft.com/en-us/library/cc748940(v=ws.10).aspx[21/3/2016 8:33:02 μμ]


Powercfg Command-Line Options

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.

- change settingvalue Modifies a setting value in the current power scheme.

- x setting value Usage:

powercfg –x setting value

setting

Specifies 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

value

Specifies the value in minutes.

Example:

powercfg -change -monitor-timeout-ac 5

This sets the monitor idle timeout value to five minutes when operating on AC
power.

- changename GUID name Modifies the name of a power scheme and, optionally, the scheme description.
[scheme_description]
Usage:

powercfg –changename GUID namescheme_description

GUID

Specifies the GUID of the power scheme

Name

Specifies the name of the power scheme.

scheme_description

https://technet.microsoft.com/en-us/library/cc748940(v=ws.10).aspx[21/3/2016 8:33:02 μμ]


Powercfg Command-Line Options

Describes the power scheme.

If the description is omitted, then only the name will be changed.

- duplicatescheme GUID [DestinationGUID] Duplicates the specified power scheme. The resulting GUID which represents the
new scheme will be displayed.

Usage:

powercfg –duplicatescheme GUID [DestinationGUID]

GUID

Specifies a scheme GUID. Obtained by using the powercfg-l command.

DestinationGUID

Specifies the GUID where the scheme will be copied.

If DestinationGUID is omitted, then a new GUID will be created for the duplicated
scheme.

-delete GUID Deletes the power scheme with the specified GUID.

-d GUID Usage:

Powercfg –delete GUID

GUID

Specifies the GUID of the scheme. Obtained by using the -list option.

-deletesetting Sub_GUID Setting_GUID Deletes a power setting.

Usage:

powercfg –deletesetting Sub_GUID Setting_GUID

Sub_GUID

Specifies the subgroup GUID.

Setting_GUID

Specifies the power setting GUID.

-setactive Scheme_GUID Makes the specified power scheme active on the computer.

-s Scheme_GUID Usage:

Powercfg –setactive Scheme_GUID

Scheme_GUID

Specifies the scheme GUID.

https://technet.microsoft.com/en-us/library/cc748940(v=ws.10).aspx[21/3/2016 8:33:02 μμ]


Powercfg Command-Line Options

-getactivescheme Retrieves the currently active power scheme.

Usage:

Powercfg -getactivescheme

-setacvalueindex Scheme_GUID Sub_GUID Sets a value associated with a specified power setting while the computer is
Setting_GUID SettingIndex powered by AC power.

Usage:

powercfg –setacvalueindex Scheme_GUIDSub_GUIDSetting_GUIDSettingIndex

Scheme_GUID

Specifies a power scheme GUID. Obtained by using the -l option.

Sub_GUID

Specifies a subgroup of power setting GUID. Obtained by using the -q option.

Setting_GUID

Specifies an individual power setting GUID. Obtained by using the -q option.

SettingIndex

Specifies which of the list of possible values this power setting will be set to.

Example:

powercfg –setacvalueindex Scheme_GUID Sub_GUID Setting_GUID 5

This sets the power setting's AC value to the fifth entry in the list of possible values
for this power setting.

-setdcvalueindex Scheme_GUID Sub_GUID Sets a value associated with a specified power setting while the computer is
Setting_GUID SettingIndex powered by DC power.

Usage:

powercfg –setdcvalueindex Scheme_GUID Sub_GUID Setting_GUID


SettingIndex

Scheme_GUID

Specifies a power scheme GUID. Obtained by using the -l option.

Sub_GUID

Specifies a subgroup of power setting GUID. Obtained by using the -q option.

Setting_GUID

Specifies an individual power setting GUID. Obtained by using the -q option.

SettingIndex

https://technet.microsoft.com/en-us/library/cc748940(v=ws.10).aspx[21/3/2016 8:33:02 μμ]


Powercfg Command-Line Options

Specifies which of the list of possible values this power setting will be set to.

Example:

powercfg –setdcvalueindex Scheme_GUID Sub_GUID Setting_GUID 5

This sets the power setting's DC value to the fifth entry in the list of possible values
for this power setting.

-hibernate [on|off] Enables or disables the hibernate feature. Hibernate timeout is not supported on all
computers.
-h [on|off]
Example: powercfg-h on

-availablesleepstates Reports the sleep states available on the computer. Attempts to report reasons why
sleep states are unavailable.
-a

-devicequery query_flags Returns a list of devices that meet the specified criteria.

Usage:

powercfg –devicequery query_flags

query_flags

Specifies one of the following criteria:

wake_from_S1_supported – Returns all devices that support waking the computer


from a light sleep state.

wake_from_S2_supported – Returns all devices that support waking the computer


from a deeper sleep state.

wake_from_S3_supported – Returns all devices that support waking the computer


from the deepest sleep state.

wake_from_any – Returns all devices that support waking the computer from any
sleep state.

S1_supported – Lists devices supporting light sleep.

S2_supported – Lists devices supporting deeper sleep.

S3_supported – Lists devices supporting deepest sleep.

S4_supported – Lists devices supporting hibernation.

wake_programmable – Lists devices that are user-configurable to wake the


computer from a sleep state.

wake_armed – Lists devices that are currently configured to wake the computer
from any sleep state.

all_devices – Returns all devices present in the computer.

all_devices_verbose – Returns a verbose list of devices.

https://technet.microsoft.com/en-us/library/cc748940(v=ws.10).aspx[21/3/2016 8:33:02 μμ]


Powercfg Command-Line Options

Example:

powercfg -devicequery wake_armed

-deviceenablewake devicename Enables the device to wake the computer from a sleep state.

Usage:

powercfg –deviceenablewake devicename

devicename

Specifies a device retrieved by using the powercfg-


devicequerywake_programmable command.

Example:

powercfg -deviceenablewake "Microsoft USB IntelliMouse Explorer"

-devicedisablewake devicename Disables the device from waking the computer from a sleep state.

Usage:

powercfg –devicedisablewake devicename

devicename

Specifies a device retrieved by using the powercfg-devicequerywake_armed


command.

-import filename [GUID] Imports all power settings from the specified file.

Usage:

powercfg –import filename [GUID]

filename

Specifies a fully qualified path to a file generated by using the powercfg-export


option.

GUID

(optional) Represents the settings loaded into a power scheme. If not supplied,
Powercfg will generate and use a new GUID

Example:

powercfg -import c:\scheme.pow

-export filename GUID Exports a power scheme, represented by the specified GUID, to the specified file.

Usage:

powercfg -export filename GUID

https://technet.microsoft.com/en-us/library/cc748940(v=ws.10).aspx[21/3/2016 8:33:02 μμ]


Powercfg Command-Line Options

filename

Specifies a fully qualified path to a destination file.

GUID

Specifies a power scheme GUID. Obtained by using the /l option.

Example:

powercfg -export c:\scheme.pow 381b4222-f694-41f0-9685-ff5bb260df2e

-lastwake Reports information about the event that woke the computer from the last sleep
transition.

-help Displays information about the Powercfg command-line options.

-?

-aliases Displays all aliases and their corresponding GUIDs. The user may use these aliases
in place of any GUID at the command prompt

-setsecruitydescriptor [GUID|Action] SDDL Sets a security descriptor associated with a specified power setting, power scheme,
or action.

Usage:

powercfg -setsecuritydescriptor [GUID|Action] SDDL

GUID

Specifies a power scheme or a power setting GUID.

Action

Specifies one of the following strings: ActionSetActive, ActionCreate,


ActionDefault

SDDL

Specifies a valid security descriptor string in SDD format. Call powercfg -


getsecuritydescriptor to see an example SDDL STRING.

-getsecuritydescriptor [GUID|Action] Gets a security descriptor associated with a specified power setting, power scheme,
or action.

Usage:

powercfg -getsecuritydescriptor [GUID|Action]

GUID

Specifies a power scheme or a power setting GUID.

Action

https://technet.microsoft.com/en-us/library/cc748940(v=ws.10).aspx[21/3/2016 8:33:02 μμ]


Powercfg Command-Line Options

Specifies one of the following strings: ActionSetActive, ActionCreate,


ActionDefault

See Also
Concepts
Command-Line Tools Technical Reference

Community Additions AD
D

Battery mgnt problem


Asus
EEE PC 1015PEM   with brand new Battery (10 days)  A32-1015 installed on a Win 7  BAttery fully opertional 100% load to 0%  and reload to
100% (10 days of smooth operation before WIN 10 upgrade)

BAttery loading Problem after upgrading to Win 10: (Although the Netbook is fully functionnal)

(Power cable disconnected) battery goes normally smotthly down according to usage.

-
Connecting the power cable,  Battery does load  for 10 sec max and then stops loading ! (whatever the battery load level)

- By removing/ reconnecting the cable every 10 sec, th ebatttery loads upto 53 to 55% max and then can't increase above.

- This situation is  repeatable... and green light of the battery stays on.

- Coonnecting the power with an already connected netbook same behavior !

- Microsoft ACPI compatible Battery management seems to be crazy !

- Is there a way to permanantly bypass Microsoft ACPI compatible Battery management?

- Does  the bios ACPI.SYS have an influence?

' Is ther any parameter to customize in Combatt.inf ?

' Why microft is so silent on surch a long issue rporte in all the blogs since Win 8 ?

https://technet.microsoft.com/en-us/library/cc748940(v=ws.10).aspx[21/3/2016 8:33:02 μμ]


Powercfg Command-Line Options

- How to keep recommending migrate to 8 or 10 ? PLEASE HELP ! THX

'

Olivier 57
2/13/2016

Mr
Famous Belgian

Olivier 57
2/13/2016

plug in not charging



i have the same charger i was using before , it was working
well but now it can not charge and i tried other chargers still it exist not charging . i
need your help

intel copppp
10/14/2015

friendly \ generic GUID's?


http://support.microsoft.com/kb/2835052 a good article I used to stop a 2012 server locking the screen so often.

An example from it powercfg.exe /setacvalueindex SCHEME_CURRENT SUB_VIDEO VIDEOIDLE <time in seconds>

I can use SCHEME_CURRENT in other commands, but how do we find out sub guid generic \ friendly names?

-Mr Happy-
1/8/2015

Spelling Error

-setsecruitydescriptor 
[
GUID
|
Action

SDDL

https://technet.microsoft.com/en-us/library/cc748940(v=ws.10).aspx[21/3/2016 8:33:02 μμ]


Powercfg Command-Line Options

should be

-setsecURitydescriptor 
[
GUID
|
Action

SDDL

errant_sunset
5/29/2014

Remove password on wakeup


what is the command line option for Remove password on wake up

Aravind mano
2/27/2014

Utterly Futile!
Trying to run this command against schemes pushed out by GPO:

The GUID is different on every machine!

This makes this article pretty irrelevant.

buffer overflow 0xG


12/19/2013

https://technet.microsoft.com/en-us/library/cc748940(v=ws.10).aspx[21/3/2016 8:33:02 μμ]


Powercfg Command-Line Options

Switch -auto
Hi,

the switch -energy is documented, but the subswitch -auto wich is used in the default Taskscheduler entry "Power Efficiency Diagnostic“ is not.

Why?

Heinz-Uwe
1/29/2013

Please document: "Powercfg -setactive GUID" should be ran after any changes to the active scheme.

Could you document in the -setactive command line section that in order for changes to the active power scheme to take effect
and be applied
without a reboot that the user needs to run powercfg -setactive {Scheme_GUID} .  

If the current profile you are modifying is already the "active" profile, the current wording of "Makes the specified power scheme active on the
computer" makes it sound like you should not have to run the -setactive command.  But, in fact you do have to run the -setactive command in
order for any changes to be applied to the active scheme.

Keith Kepler
9/28/2012

What operating system?



PowerCFG.exe has different parameters in Windows XP and Windows 7. Which is not specified. In my opinion, sloppiness is common at Microsoft.

Michael Jennings
9/1/2012

What operating system?



PowerCFG.exe has different parameters in Windows XP and Windows 7. Which is not specified. In my opinion, sloppiness is common at Microsoft.

Michael Jennings
9/1/2012

can be deleted
can be deleted

LHUSSIEZ Pierre
7/11/2012

https://technet.microsoft.com/en-us/library/cc748940(v=ws.10).aspx[21/3/2016 8:33:02 μμ]


Powercfg Command-Line Options

Save current config : a solution


You can se the folllowing .bat file:

REM move to the path of the executing batch


cd /d %~dp0

REM Get the GUID of the Active Scheme


for /f "tokens=2 delims=:(" %%x in ('powercfg -getactivescheme') do set ActiveSchemeGUID=%%x

REM export
powercfg -EXPORT ./PowerCfgActiveScheme.pow %ActiveSchemeGUID%

LHUSSIEZ Pierre
7/11/2012

Disabling sleep with a task that wakes from sleep doesn't work (the computer still sleeps).

To avoid your system going to sleep during an important task you may wish to disable sleep using the command line. Unfortunately
it seems that if
you try to accomplish this through a task that itself resumes from sleep (e.g., scheduled task) it fails to achieve the desired result.

Use case: Scheduled back-up of system that is


set to sleep after X minutes. System is sleeping prior to the scheduled
back-up. Need to wake the
computer and disable sleep, else it will go to sleep during the back-up.

Pre-backup scheduled task (wakes from sleep and executes)

powercfg -x standy-timeout-ac 0

Post-backup (re-enables sleep, where X is the number of minutes before the system should sleep)

powercfg -x standy-timeout-ac X

The
scheduled task to wake works fine, it also disables sleep so that when you inspect it from the control panel sleep appears to be disabled,

however, confirmed by event viewer, Windows will then go back to sleep (due to Idle) even though sleep has been disabled.

Wayne Hartell
5/11/2012

powercfg does not except "-" as operator need to use "/"


when I try to use powercfg -h off I get the error "invalid parameters"
if I use powercfg /h off, it works

This is on Windows 7 Ultimate x64. As there a difference on how to use the parameters?

https://technet.microsoft.com/en-us/library/cc748940(v=ws.10).aspx[21/3/2016 8:33:02 μμ]


Powercfg Command-Line Options

ReveTahw
4/4/2012

-qh option in Windows 7


-QH Displays the contents of the specified power scheme, including hidden ones.

Usage: POWERCFG -QH &lt;SCHEME_GUID&gt; &lt;SUB_GUID&gt;

&lt;SCHEME_GUID&gt; (optional) Specifies the GUID of the power scheme


to display, can be obtained by using powercfg -l.
&lt;SUB_GUID&gt; (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, including hidden settings, are
displayed. If SUB_GUID is not specified, all settings in the specified power scheme, including hidden settings, are displayed.

lauwens
12/6/2011

-energy option in Windows 7


-ENERGY
Analyze 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. The ENERGY command
supports the following optional parameters:

Usage: POWERCFG -ENERGY [-OUTPUT &amp;lt;FILENAME&amp;gt;] [-XML]


[-DURATION &amp;lt;SECONDS&amp;gt;]
POWERCFG -ENERGY -TRACE [-D &amp;lt;FILEPATH&amp;gt;]
[-DURATION &amp;lt;SECONDS&amp;gt;]
-OUTPUT &amp;lt;FILENAME&amp;gt; - Specify the path and filename to store the
energy report HTML file.
-XML - Format the report file as XML.
-TRACE - Record system behavior and do not perform
analysis. Trace files will be generated in
the current path unless the -D parameter
is specified.
-D &amp;lt;FILEPATH&amp;gt; - Specify the directory to store trace data.
May only be used with the -TRACE parameter.

-DURATION &amp;lt;SECONDS&amp;gt; - Specify the number of seconds to observe


system behavior. Default is 60 seconds.

https://technet.microsoft.com/en-us/library/cc748940(v=ws.10).aspx[21/3/2016 8:33:02 μμ]


Powercfg Command-Line Options

msharoknian
11/13/2011

Save current config


How about an easy way to save the current power config in a script.

I want to save the current config, change it (e.g. prevent standby and hibernate timeouts), run a long command, then restore the saved power
config and set it as the current scheme. There seems to be no command to 'export current scheme'

e.g.

powercfg -Export current.POW

Steve6375
10/10/2011

Note: -REQUESTSOVERRIDE is case-sensitive


Please note that -REQUESTSOVERRIDE (in Win7) is case-sensitive.

John E [MSFT]
10/3/2011

- requests and requestsoverride option in Windows 7


-REQUESTS Enumerate application and driver Power Requests. Power Requests prevent the computer from automatically powering off the display
or entering a low-power sleep mode.

-REQUESTSOVERRIDE Sets 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.

Usage: POWERCFG -REQUESTSOVERRIDE <CALLER_TYPE> <NAME> <REQUEST>

https://technet.microsoft.com/en-us/library/cc748940(v=ws.10).aspx[21/3/2016 8:33:02 μμ]


Powercfg Command-Line Options

<CALLER_TYPE> Specifies one of the following caller type: PROCESS, SERVICE, DRIVER. This is obtained by calling the POWERCFG -REQUESTS
command.
<NAME> Specifies the caller name. This is the name returned from calling POWERCFG -REQUESTS command.
<REQUEST> Specifies one or more of the following Power. Request Types: Display, System, Awaymode.
Example: POWERCFG -REQUESTSOVERRIDE PROCESS wmplayer.exe Display System

To remove the power request override, use the -REQUESTSOVERRIDE option, but do not specify any type of override (System, Display, AwayMode)
as in the following example:
Example:

POWERCFG -REQUESTSOVERRIDE PROCESS wmplayer.exe

Thomas Lee
7/12/2011

-waketimers option in Windows 7


-WAKETIMERS
Enumerate the active wake timers. If enabled, the expiration of a wake timer wakes the system from sleep and hibernate states.

Mark Aggar
6/24/2010

Manage Your Profile |


Site

Feedback © 2016 Microsoft

Flash Newsletter | Contact Us | Privacy Statement | Terms of Use | Trademarks

https://technet.microsoft.com/en-us/library/cc748940(v=ws.10).aspx[21/3/2016 8:33:02 μμ]

Vous aimerez peut-être aussi