Jump to content

Power Policies


dufran3
 Share

Recommended Posts

This is what I am trying to do. Change the power settings of a computer. Change everything to "never" and disable hibernate. I would like to accomplish this without having to open up the actual powercfg.cpl control panel. This is what I have. I went under the power settings, changed all the settings to "never" then choose save as, then created a name for it. What happens is, I go look under the control panel when running this on another computer, and the settings are at normal home/office settings, but with the correct power policy name...any help with this would be awsome!

Func PowerPC()
        ;Change Power Profile
    $CurrentPower = "HKCU\Control Panel\PowerCfg\"
    $CurrentPowerVal = RegRead($CurrentPower,"CurrentPowerPolicy")
    $powerpath = "HKCU\Control Panel\PowerCfg\PowerPolicies\6"
    $powerval = Regread($powerpath,"Name")
    RegWrite($powerpath)
    RegWrite($powerpath,"Description","REG_SZ","Everything always on!")
    RegWrite($powerpath,"Name","REG_SZ","Custom PC")
    RegWrite($powerpath,"Policies","REG_BINARY",'01,00,00,00,00,00,00,00,01,00,00,00,00,00,00,00,02,00,00,00,05,00,00,00,00,00,00,0,00,00,00,00,78,00,00,00,32,32,03,02,04,00,00,00,04,00, 00,00,00,00,3d,77,2e,f2,07,00,00,00,00,00,3c,00,00,00,00,00,00,00,b4,00,00,00,00,00,64,64,64,64,91,7c')

    If $CurrentPowerVal <> "6" Then
        regwrite($CurrentPower,"CurrentPowerPolicy","Reg_SZ","6")
    EndIf

    ;Disable Hibernate
    _RunDOS("POWERCFG.exe /HIBERNATE off")
    
    ;Log Setting Change
    _LogCheck("1","PowerPC",$powerpath,"Name","Custom PC")
EndFunc
Edited by dufran3
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...