Richard Smith

Consultant - Microsoft Services - United Kingdom

powercfg - Useful if you know the GUIDS!

powercfg - Useful if you know the GUIDS!

  • Comments 7
  • Likes

So I have been doing some work with powercfg - and found it a very useful tool for scripting power management options during builds. This command utility is installed with Windows Vista and you can use it to control power settings and configure computers to default to Hibernate or Standby modes.

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 ]

Full details of the switches can be found here

So having delved into this utility a little more - here are my top commands for powercfg ready to use in your scripts:

sets the power configuration to High Performance
powercfg -setactive 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c

tweaks the basic power settings
powercfg -change -hibernate-timeout-ac 0
powercfg -change -hibernate-timeout-dc 0

turns hibernation off
powercfg -hibernate OFF

require password when console wakes up (0=false, 1=true)
powercfg -setacvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c fea3413e-7e05-4911-9a71-700331f1c294 0e796bdb-100d-47d6-a2d5-f7d2daa51f51 0
powercfg -setdcvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c fea3413e-7e05-4911-9a71-700331f1c294 0e796bdb-100d-47d6-a2d5-f7d2daa51f51 0

also needed to show up on Power Menus...
powercfg -setacvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e fea3413e-7e05-4911-9a71-700331f1c294 0e796bdb-100d-47d6-a2d5-f7d2daa51f51 0
powercfg -setdcvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e fea3413e-7e05-4911-9a71-700331f1c294 0e796bdb-100d-47d6-a2d5-f7d2daa51f51 0

power plan type (0=power saver, 1=high performance, 2=balanced)
powercfg -setacvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c fea3413e-7e05-4911-9a71-700331f1c294 245d8541-3943-4422-b025-13a784f679b7 1
powercfg -setdcvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c fea3413e-7e05-4911-9a71-700331f1c294 245d8541-3943-4422-b025-13a784f679b7 1

hard disk timeout
powercfg -setacvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 0012ee47-9041-4b5d-9b77-535fba8b1442 6738e2c4-e8a5-4a42-b16a-e040e769756e 0
powercfg -setdcvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 0012ee47-9041-4b5d-9b77-535fba8b1442 6738e2c4-e8a5-4a42-b16a-e040e769756e 0

wireless adapter power (0=max perf, 1=low power saving, 2=med power saving, 3=max power saving)
powercfg -setacvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 19cbb8fa-5279-450e-9fac-8a3d5fedd0c1 12bbebe6-58d6-4636-95bb-3217ef867c1a 0
powercfg -setdcvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 19cbb8fa-5279-450e-9fac-8a3d5fedd0c1 12bbebe6-58d6-4636-95bb-3217ef867c1a 0

sleep timeout
powercfg -setacvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 238c9fa8-0aad-41ed-83f4-97be242c8f20 29f6c1db-86da-48c5-9fdb-f2b67b1f44da 0
powercfg -setdcvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 238c9fa8-0aad-41ed-83f4-97be242c8f20 29f6c1db-86da-48c5-9fdb-f2b67b1f44da 0

close action (0=do nothing, 1=sleep, 2=hibernate, 3=shutdown)
powercfg -setacvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 0
powercfg -setdcvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 0

also needed to show up on Power Menus...
powercfg -setacvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 0
powercfg -setdcvalueindex 381b4222-f694-41f0-9685-ff5bb260df2e 4f971e89-eebd-4455-a8de-9e59040e7347 5ca83367-6e45-459f-a27b-476b1d01c936 0

processor power cstate (0,1=power saver, 2,3=balanced, 4,5=high perf)
powercfg -setacvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 54533251-82be-4824-96c1-47b60b740d00 68f262a7-f621-4069-b9a5-4874169be23c 4
powercfg -setdcvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 54533251-82be-4824-96c1-47b60b740d00 68f262a7-f621-4069-b9a5-4874169be23c 4

minimum processor state
powercfg -setacvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 54533251-82be-4824-96c1-47b60b740d00 893dee8e-2bef-41e0-89c6-b55d0929964c 100
powercfg -setdcvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 54533251-82be-4824-96c1-47b60b740d00 893dee8e-2bef-41e0-89c6-b55d0929964c 100

processor power perfstate settings
powercfg -setacvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 54533251-82be-4824-96c1-47b60b740d00 bbdc3814-18e9-4463-8a55-d197327c45c0 4
powercfg -setdcvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 54533251-82be-4824-96c1-47b60b740d00 bbdc3814-18e9-4463-8a55-d197327c45c0 4

monitor timeout
powercfg -setacvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 7516b95f-f776-4464-8c53-06167f40cc99 3c0bc021-c8a8-4e07-a973-6b14cbcb2b7e 0
powercfg -setdcvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 7516b95f-f776-4464-8c53-06167f40cc99 3c0bc021-c8a8-4e07-a973-6b14cbcb2b7e 0

multimedia settings (0=take no action, 1=prevent computer from sleeping, 2=enable away mode)
powercfg -setacvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 9596fb26-9850-41fd-ac3e-f7c3c00afd4b 03680956-93bc-4294-bba6-4e0f09bb717f 2
powercfg -setdcvalueindex 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 9596fb26-9850-41fd-ac3e-f7c3c00afd4b 03680956-93bc-4294-bba6-4e0f09bb717f 2

set the absentia power scheme (the scheme used when no one is logged in)
powercfg -setabsentia 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c

Enjoy... :-)

Comments
  • PingBack from http://kacper.consulting23.info/2007/11/29/powercfg-useful-if-you-know-the-guids/

  • Check out the excellent post here detailing the GUIDs involved when using the powercfg.exe command in Vista. The dirty little secret is that powercfg.exe is also pretty much the only way to control power management inside a Windows Server 2008 Core s

  • what do you mean by "also needed to show up on Power Menus..."

  • Tested under Windows 7, here is a command to retrieve the GUID of a given profile (in this example "High Performance"):

    FOR /F "tokens=4 delims= " %%i IN ('POWERCFG -LIST ^| FIND "(High performance)"') DO POWERCFG -SetActive %%i

  • I still don't get it. Isn't life hard enough as it is? So what's the point in using a GUIDS instead of just a human-readable string such as "Balanced"?? I mean, it's the kind of thing I would expect not to have to research.

    Microsoft are the WORST at providing simple means for backing up system settings so that they can be easily restored later should the user need to re-install the OS. I was just trying to back up my power settings, and learnt that they are buried in the Registry under a key named "381b4222-f694-41f0-9685-ff5bb260df2e". For a multimillion company such as Microsoft, it's hard to believe that this is the best they can come up with.

  • I love your articles and you have helped me for years with different items but I totally 100% disagree with your suggestion of 0 for 6738e2c4-e8a5-4a42-b16a-e040e769756e.  The life expectancy of a hard drive is 2 years.  Of course that is 2 years of 100% use and it does vary.  Over the years I have noticed that people tend to leave their computers running instead of shut them down.  So since they are not intelligent enough to protect themselves I have to do it for them.  I always set every computer I have ever worked on for myself and for my clients to HD Time out on battery 5-15 minutes and on AC 20-30 minutes.

  • Leaving computers on is healthier for the hardware. Turning hardware on/off all the time makes it cool/heat and expand/contract. Leave your hard to always on. And thanks Alex for the batch file, saved me 10 minutes as FOR loops in dos for some reason is always a pain.

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment