Sign in to follow this  
Followers 0
Guest kauphy

setting controlpanel Powercfg key

2 posts in this topic

Hi,

I was trying to script my windowsXP system settings. Got everything working except settings for "Power Options Properties". Need to set,

1.)Power Schemes to "Always on"

2.)Turn of monitor to "Never"

3.)Turn of hard disks to "Never"

Got the first one working by using

RegWrite("HKEY_CURRENT_USER\Control Panel\PowerCfg", "CurrentPowerPolicy", "REG_SZ", "6")

For the other two I have copied the reg-key from regedit and tried to use :

RegWrite("HKEY_CURRENT_USER\Control Panel\PowerCfg\PowerPolicies\6", "Policies", "REG_BINARY", "hex:01,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,02,00,00,00,00,00,00,00,00,00,00,00,00,00,0

0,00,2c,01,00,00,32,32,00,03,02,00,00,00,02,00,00,00,00,00,3d,77,2e,f2,07,00,00,00,00,00,2c,01,00,00

,00,00,00,00,58,02,00,00,01,01,64,64,64,64,91,7c")

But for somereason, it is not setting the desired properties. I tried "exporting the registry settings->changed the properties->and then run the exported reg key manually" this works, but getting the same done by autoit doesnt.

Any idea why its happening or any error that I am making.

thanks,

purna.

Share this post


Link to post
Share on other sites



RegWrite('HKEY_CURRENT_USER\Control Panel\PowerCfg\PowerPolicies\6', 'Policies', 'REG_BINARY', _
        '0100000000000000010000000000000002000000000000000000_
        0000000000002c01000032320003020000000200000000003d77_
        2ef20700000000002c0100000000000058020000010164646464917c')

Don't use the "quot;hex:" string. You are already using the correct method of entry, by using the REG_BINARY parameter. Then remove the comma's from the hex string. Then it will work as expected.

:)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0