Importing and activating power settings without Group Policy

nstevenson

New member
Local time
1:39 PM
Messages
4
Hi,
I have a problem which is giving me a headache. Hopefully someone out there knows a way round.
Basically we are looking to roll out Win 7 64 bit in my company and are currently working on some test models. (At present we use all XP and Server 2003)
I am building a few test machines and want to find a way to standarize the power settings without having the power settings GPO as (as far as I can tell) that is only available on Server 2008.
So far I have created a new settings scheme called powertest.pow and exported it to a central network location.
I can then have other machines import it easily anough by script.
Then I get stuck. I can only find a way to activate .pow by GUID rather than friendly name and each time the powertest.pow is imported on a new PC it generates a new and unique GUID.
If I could activate the .pow by friendly name this would be easy, but this doesn't seem to be possible (?). So - what next? Do I need to somehow query the registry, extract the GUID, and then use that to activate my scheme? If so, how? And is it scriptable?
Thanks in advance for any help or advice that might be out there.
Neil.
 

My Computer My Computer

At a glance

Win 7 64 Bit
OS
Win 7 64 Bit
I can't give you a definitive answer, but I do know that somewhere in the registry the name must be mapped to the GUID. If you search the registry for the power settings name you should be able to find where that is stored. From there it shouldn't be a hard thing to grab the GUID and use it.

The only other possibility is that all of the power settings are stored in one place in the registry and you could just iterate over all of the settings until you found the one with the right name and apply that one.

Hope these ideas give you a push in the right direction.
 

My Computer My Computer

At a glance

Windows 7 Ultimate x64Core i5 7602x2GB Mushkin PC3-10666GeForce GTX 460
Computer Manufacturer/Model Number
Home Build
OS
Windows 7 Ultimate x64
CPU
Core i5 760
Motherboard
Biostar T5XE (P55)
Memory
2x2GB Mushkin PC3-10666
Graphics Card(s)
GeForce GTX 460
Internet Speed
FiOS 25Gbps down & up
Hi,
My previous reply appears not to have been posted so i'll try again: apologies if they now both come up.
Thanks for your response. I was leaning in that direction myself. All the information you mention is avilable in the registry. Under HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Power\User\PowerSchemes all the power schemses are listed by GUID, and within each subkey the Power scheme friendly name is listed as data.
it's basically the same information you can get from powercfg /l .
What i don't know how to do though is set up a way to automatically acquire this information for each new PC going forward. it will be easy to remotely set which power schem e hould be active remotely with the relevant GUIDs but if i have to manually go and get the GUIDs each time it will sort of defeat the point.
Thanks
again
N
 

My Computer My Computer

At a glance

Win 7 64 Bit
OS
Win 7 64 Bit
What you need to do is write a script that queries the registry for all of the power schemes. Once you have that data set, check each one of them for the proper "friendly name" and grab the GUID for that and then apply that scheme.

Sorry I don't have any sample code for you to check out, but hopefully Google can provide that for you.
 

My Computer My Computer

At a glance

Windows 7 Ultimate x64Core i5 7602x2GB Mushkin PC3-10666GeForce GTX 460
Computer Manufacturer/Model Number
Home Build
OS
Windows 7 Ultimate x64
CPU
Core i5 760
Motherboard
Biostar T5XE (P55)
Memory
2x2GB Mushkin PC3-10666
Graphics Card(s)
GeForce GTX 460
Internet Speed
FiOS 25Gbps down & up
OK. thanks for the help and advice.
Time to get better at scripting I suppose...
 

My Computer My Computer

At a glance

Win 7 64 Bit
OS
Win 7 64 Bit
This is actually much simpler than I thought it was.
For those trying to do the same thing, don't take the path I took. Importing pre-defined .pow schemes and trying to activate them is barking up the wrong tree.
What you can do instead it have a very simple .bat which copies one of the default powerschemes (as their GUIDs are the same on every single Win 7 machine), rename it and then change the configs by script. Same result as what i set out trying to do and so much easier.
Here is an example of the script you could use:

POWERCFG -DUPLICATESCHEME 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635c 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635d
POWERCFG -CHANGENAME 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635d "Superdupertest1"
POWERCFG -SETACTIVE 8c5e7fda-e8bf-4a96-9a85-a6e23a8c635d
POWERCFG -Change -monitor-timeout-ac 0
POWERCFG -CHANGE -monitor-timeout-dc 0
POWERCFG -CHANGE -disk-timeout-ac 0
POWERCFG -CHANGE -disk-timeout-dc 0
POWERCFG -CHANGE -standby-timeout-ac 0
POWERCFG -CHANGE -standby-timeout-dc 0
POWERCFG -CHANGE -hibernate-timeout-ac 0
POWERCFG -CHANGE -hibernate-timeout-dc 0
 

My Computer My Computer

At a glance

Win 7 64 Bit
OS
Win 7 64 Bit
Another way to do it is to you the optionnal arguement of the "IMPORT" trigger and set a GUID to use when you import your .POW file

EX: powercfg /import c:\Some_File.pow FFFFFF-DDDD-CCCC-BBBB-000123456789

Using this technique you still use the GUID but you can set it to something that is somewhat useable.
 

My Computer My Computer

At a glance

Windows 7 Enterprise x64
OS
Windows 7 Enterprise x64
Back
Top