Windows 7 Power Scheme Configuration using POWERCFG.EXE

Posted on December 15, 2011 by Jeff Hicks in Windows 7 with 0 Comments

If you are responsible for supporting or managing laptops, you most likely have found the need to properly configure power settings or the “power scheme“. Or if not, perhaps this is a task you should look into. You could use the GUI in Control Panel, or you could take advantage of a command line tool in Windows 7 called POWERCFG.EXE and maximize your efficiency. Let’s look at a few features of this handy utility.

First, open a command prompt (or PowerShell if you prefer) and run this command:

Power Scheme Powercfg Help

Figure 1 Powercfg help
As you can see there are many ways to use this tool. You can use either the long parameter names or the short. If you are going to be scripting anything with this utility, I suggest using the long parameter names. It won’t impact the command but will make your script easier to read.

Sponsored

List Power Schemes

First, let’s see what schemes are currently available.

Power Scheme Existing Power Schemes

Figure 2 Existing Power Schemes
The setting marked with an asterisk is the current setting. Depending on your laptop vendor and installed applications you will most likely have a different list. Or if you simply wanted to see the active scheme, use this command:

But what is in these schemes? We can use the –Query parameter. By default it shows all scheme details.

Power Scheme Querying PowerScheme Details
Figure 3 Querying PowerScheme Details

 

Otherwise, you will need to copy and paste a GUID.

Because there is so much information, you might want to pipe to the MORE command to get details in paged form.

Setting Power Schemes

Let’s suppose that I want to change the power scheme to Balanced. To accomplish this I need to know the scheme’s GUID, which I can get with the -List parameter. Fortunately, the Microsoft created power schemes use GUIIDs that are the same across computers. Thus I can run this same command across all my laptops.

Or more likely I’d create a simple batch file.

If you want to create your own scheme, or even modify an existing one, I’d recommend first creating a duplicate scheme, which will generate a new GUID.

Power Scheme Duplicating

Figure 4 Duplicating a Power Scheme
But now I have two schemes with the same name.

Now I’ve renamed it to “MyPower” and added an optional description. There are a number of things I might want to change, but for the sake of this article I’ll configure the Power button to shutdown when on AC. This is going to require knowing some GUIDS and hex values for the different settings so I’ll save the settings to a text file so I can copy and paste.

This is the relevant section.

Currently it is set to Sleep. Here’s the command to change it.

Now you see why copying and pasting is necessary. The first GUID is for the scheme, the second is for the sub group and the third is for the setting. The last number is the index number from the list of possible settings.

Sponsored

Import and Export PowerSchemes

If I want to reuse this on another computer I can export it.

The exported file is not anything you can edit. Now I can go to my other laptop and import it.

Unfortunately, this is where it gets tricky, especially if you are trying to automate and of this. When you import, the scheme gets a new GUID. So to assign this as the new default I have to manually intervene or use a few scripting techniques to discover and re-use the GUID. But it is not impossible.

Conclusion

As you’ve seen, Powercfg.exe requires a fair amount of typing and almost all commands require you to specify the GUID. Yet I hope this doesn’t deter you from taking advantage of this valuable utility.

Sponsored