X-Ecutioner

Where to find power settings in registry?

21 posts in this topic

I'm makin an unattended install for my laptop and I want to know where to find the settings for the power configuration settings in the registry? Like the standby time and hibernation and standby options. Anyone know?

0

Share this post


Link to post
Share on other sites

i don't know but i can suggest u powercfg

(right now i'm in a comp that doesn't have powercfg therefore i cannot tell u the switches to use)

u can create a new or use an existing power profile and make changes to it....

i know that doesn't answer the question I'll try to get back to u when i get back...

0

Share this post


Link to post
Share on other sites

How about here....

[HKEY_CURRENT_USER\Control Panel\PowerCfg]

0

Share this post


Link to post
Share on other sites

ok here's the usage of powercfg which u can get with powercfg /?

POWERCFG [/list | /QUERY [name]| /CREATE name | /DELETE name |

    /SETACTIVE name | /CHANGE name settings |

    /HIBERNATE {ON|OFF} | /EXPORT name [/FILE filename] |

    /IMPORT name [/FILE filename] | /GLOBALPOWERFLAG {ON|OFF} /OPTION flag |

    /BATTERYALARM {LOW|CRITICAL} [settings] |

    /DEVICEQUERY queryflags | /DEVICEENABLEWAKE devicename |

    /DEVICEDISABLEWAKE devicename | /?]

Description:

    This command line tool enables an administrator to control

    the power settings on a system.

Parameter List:

    /LIST, /L    Lists the names of existing power schemes.

    /QUERY, /Q      Displays the configuration of the specified power scheme.

                    If no name is specified, the configuration of the currently

                    active power scheme is displayed.

    /CREATE, /C  Creates a power scheme with the specified name.  The new

                    scheme is created with the properties of the currently

                    active scheme.

    /DELETE, /D  Deletes the power scheme with the specified name.

    /SETACTIVE, /S  Makes the power scheme with the specified name active.

    /CHANGE, /X  Changes settings of the specified power scheme. Additional

                    switches specify the changes as follows:

                        /monitor-timeout-ac <minutes>

                        /monitor-timeout-dc <minutes>

                        /disk-timeout-ac <minutes>

                        /disk-timeout-dc <minutes>

                        /standby-timeout-ac <minutes>

                        /standby-timeout-dc <minutes>

                        /hibernate-timeout-ac <minutes>

                        /hibernate-timeout-dc <minutes>

                        /processor-throttle-ac <throttle>

                        /processor-throttle-dc <throttle>

                    AC settings are used when the system is on AC power.

                    DC settings are used when the system is on battery power.

                    Setting a timeout to zero will disable the corresponding

                    timeout feature.  Supported throttle settings are NONE

                    CONSTANT, DEGRADE, and ADAPTIVE.

    /EXPORT, /E  Exports the power scheme with the specified name to a

                    file.  If no filename is specified, the default is

                    SCHEME.POW.  This additional parameter is supported:

                        /FILE <filename>

    /IMPORT, /I  Imports the power scheme from a file under the specified

                    name.  If no filename is specified, the default is

                    SCHEME.POW.  If a scheme with that name already exists, it

                    is replaced with the new one.  This additional parameter

                    is supported:

                        /FILE <filename>

    /HIBERNATE, /H {ON|OFF}  Enables/Disables the hibernate feature.  Hibernate

                    timeout is not supported on all systems.

    /NUMERICAL, /N  Allows the power scheme to be operated upon to be specified

                    using a numerical identifier.  When using this switch, in

                    place of the name of the power scheme on the command line,

                    specify its numerical identifier.  This switch may be used

                    in combination with the /QUERY, /DELETE, /SETACTIVE,

                    /CHANGE, /EXPORT, and /IMPORT commands.

    /GLOBALPOWERFLAG, /G {ON|OFF}  Turns one of the global power flags on/off.

                    Valid flags (to be used after "/OPTION ") are:

                      BATTERYICON:    Turns the battery meter icon in the

                                      system tray on/off.

                      MULTIBATTERY: Turns on/off multiple battery display

                                      in system Power Meter.

                      RESUMEPASSWORD: Prompt for password on resuming the

                                      system.

                      WAKEONRING:  Turn on/off wake on ring support.

                      VIDEODIM:    Turn on/off support for dimming video

                                      display on battery power.

    /AVAILABLESLEEPSTATES, /A  Reports the sleep states available on the

                    system.  Attempts to report reasons why sleep states are

                    unavailable.

    /BATTERYALARM, /B {LOW|CRITICAL}  Configures the battery alarm.  The

                    following switches can be specified:

                        /activate <on|off>

                            Enables or disables the alarm.

                        /level <percentage (0 - 100)>

                            The alarm will be activated when the power level

                            reaches this percentage.

                        /text <on|off>

                            Turns the text notification on or off.

                        /sound <on|off>

                            Turns the audible notification on or off.

                        /action <none|shutdown|hibernate|standby>

                            Specifies the action to take when this alarm goes

                            off.  Not all actions are always available.

                        /forceaction <on|off>

                            Force stand by or shutdown even if a program stops

                            responding.

                        /program <on|off>

                            Specifies a program to run.  schtasks.exe /change

                        may be used to configure the program.

    /DEVICEQUERY <queryflags> will return a list of devices that meet the

                    criteria specified in <queryflags>.  Possible values

                    for <queryflags> are:

                    wake_from_S1_supported - return all devices that support

                          waking the system from a light sleep state.

                    wake_from_S2_supported - return all devices that support

                          waking the system from a deeper sleep state.

                    wake_from_S3_supported - return all devices that support

                          waking from the deepest sleep state.

                    wake_from_any - return all devices that support waking

                          from any sleep state.

                    S1_supported - list devices supporting light sleep states.

                    S2_supported - list devices supporting deeper sleep.

                    S3_supported - list devices supporting deepest sleep.

                    S4_supported - list devices supporting system hibernation.

                    wake_programmable - list devices that are user-configurable

                          to wake the system from a sleep state.

                    wake_armed - list devices that are currently configured to

                          wake the system from any sleep state.

                    all_devices - return all devices present in the system.

                    all_devices_verbose - return verbose list of devices.

    /DEVICEENABLEWAKE <devicename> enable the device to wake the system from a

                    sleep state. <devicename> is a device retrieved using

                    the '/DEVICEQUERY wake_programmable' parameter.

    /DEVICEDISABLEWAKE <devicename> disable the device from waking the system

                    from a sleep state. <devicename> is a device retrieved

                    using the '/DEVICEQUERY wake_armed' parameter.

    /HELP, /?    Displays information on command-line parameters.

Examples:

    POWERCFG /LIST

    POWERCFG /QUERY scheme

    POWERCFG /QUERY

    POWERCFG /CREATE scheme

    POWERCFG /DELETE scheme

    POWERCFG /SETACTIVE scheme

    POWERCFG /CHANGE scheme /monitor-timeout-dc 15

    POWERCFG /CHANGE scheme /monitor-timeout-dc 0

    POWERCFG /HIBERNATE on

    POWERCFG /EXPORT scheme /file file

    POWERCFG /QUERY number /NUMERICAL

    POWERCFG /GLOBALPOWERFLAG on /OPTION BATTERYICON

    POWERCFG /AVAILABLESLEEPSTATES

    POWERCFG /BATTERYALARM low

    POWERCFG /BATTERYALARM critical /ACTIVATE on /LEVEL 6 /ACTION hibernate

    POWERCFG /DEVICEQUERY wake_armed

    POWERCFG /DEVICEENABLEWAKE "Microsoft USB IntelliMouse Explorer"

if u need help with this i can help I've been using it..

0

Share this post


Link to post
Share on other sites

Just so you know, powercfg.exe won't be available in Windows XP until SP2

0

Share this post


Link to post
Share on other sites

Attached.

I haven't tested to see if its dependant on anything though.

powercfg.exe

0

Share this post


Link to post
Share on other sites

its dependent on something...just the exe does nothing...i tried a powercfg /? and /help and nothin

0

Share this post


Link to post
Share on other sites

hmm wierd let me check

// File name: C:\WINDOWS\system32\powercfg.exe

// Created  : 27:03:2004 14:27

// Type  : Dependencies

activeds.dll  c:\windows\system32\activeds.dll

adsldpc.dll  c:\windows\system32\adsldpc.dll

advapi32.dll  c:\windows\system32\advapi32.dll

advpack.dll  c:\windows\system32\advpack.dll

apphelp.dll  c:\windows\system32\apphelp.dll

atl.dll c:\windows\system32\atl.dll

authz.dll  c:\windows\system32\authz.dll

browseui.dll  c:\windows\system32\browseui.dll

cabinet.dll  c:\windows\system32\cabinet.dll

cdfview.dll  c:\windows\system32\cdfview.dll

certcli.dll  c:\windows\system32\certcli.dll

cfgmgr32.dll  c:\windows\system32\cfgmgr32.dll

clusapi.dll  c:\windows\system32\clusapi.dll

comctl32.dll  c:\windows\winsxs\x86_microsoft.windows.common-controls_6595b64144ccf1df_6.0.2600.2096_x-ww_a7d210bd\comctl32.dll

comdlg32.dll  c:\windows\system32\comdlg32.dll

credui.dll  c:\windows\system32\credui.dll

crypt32.dll  c:\windows\system32\crypt32.dll

cryptui.dll  c:\windows\system32\cryptui.dll

cscdll.dll  c:\windows\system32\cscdll.dll

dbghelp.dll  c:\windows\system32\dbghelp.dll

devmgr.dll  c:\windows\system32\devmgr.dll

dhcpcsvc.dll  c:\windows\system32\dhcpcsvc.dll

dnsapi.dll  c:\windows\system32\dnsapi.dll

duser.dll  c:\windows\system32\duser.dll

efsadu.dll  c:\windows\system32\efsadu.dll

esent.dll  c:\windows\system32\esent.dll

gdi32.dll  c:\windows\system32\gdi32.dll

gdiplus.dll  c:\windows\winsxs\x86_microsoft.windows.gdiplus_6595b64144ccf1df_1.0.2600.2096_x-ww_51b29046\gdiplus.dll

hnetcfg.dll  c:\windows\system32\hnetcfg.dll

imagehlp.dll  c:\windows\system32\imagehlp.dll

imm32.dll  c:\windows\system32\imm32.dll

inetcomm.dll  c:\windows\system32\inetcomm.dll

iphlpapi.dll  c:\windows\system32\iphlpapi.dll

kernel32.dll  c:\windows\system32\kernel32.dll

linkinfo.dll  c:\windows\system32\linkinfo.dll

lz32.dll  c:\windows\system32\lz32.dll

mfc42u.dll  c:\windows\system32\mfc42u.dll

mlang.dll  c:\windows\system32\mlang.dll

mobsync.dll  c:\windows\system32\mobsync.dll

mpr.dll c:\windows\system32\mpr.dll

mprapi.dll  c:\windows\system32\mprapi.dll

mprui.dll  c:\windows\system32\mprui.dll

msasn1.dll  c:\windows\system32\msasn1.dll

msgina.dll  c:\windows\system32\msgina.dll

mshtml.dll  c:\windows\system32\mshtml.dll

msi.dll c:\windows\system32\msi.dll

msimg32.dll  c:\windows\system32\msimg32.dll

msoert2.dll  c:\windows\system32\msoert2.dll

msrating.dll  c:\windows\system32\msrating.dll

mssign32.dll  c:\windows\system32\mssign32.dll

msvcp60.dll  c:\windows\system32\msvcp60.dll

msvcrt.dll  c:\windows\system32\msvcrt.dll

mswsock.dll  c:\windows\system32\mswsock.dll

netapi32.dll  c:\windows\system32\netapi32.dll

netcfgx.dll  c:\windows\system32\netcfgx.dll

netman.dll  c:\windows\system32\netman.dll

netplwiz.dll  c:\windows\system32\netplwiz.dll

netrap.dll  c:\windows\system32\netrap.dll

netshell.dll  c:\windows\system32\netshell.dll

netui0.dll  c:\windows\system32\netui0.dll

netui1.dll  c:\windows\system32\netui1.dll

netui2.dll  c:\windows\system32\netui2.dll

ntdll.dll  c:\windows\system32\ntdll.dll

ntdsapi.dll  c:\windows\system32\ntdsapi.dll

ntlanman.dll  c:\windows\system32\ntlanman.dll

odbc32.dll  c:\windows\system32\odbc32.dll

ole32.dll  c:\windows\system32\ole32.dll

oleacc.dll  c:\windows\system32\oleacc.dll

oleaut32.dll  c:\windows\system32\oleaut32.dll

oledlg.dll  c:\windows\system32\oledlg.dll

olepro32.dll  c:\windows\system32\olepro32.dll

powrprof.dll  c:\windows\system32\powrprof.dll <====== this maybe??

printui.dll  c:\windows\system32\printui.dll

psapi.dll  c:\windows\system32\psapi.dll

query.dll  c:\windows\system32\query.dll

rasapi32.dll  c:\windows\system32\rasapi32.dll

rasdlg.dll  c:\windows\system32\rasdlg.dll

rasman.dll  c:\windows\system32\rasman.dll

regapi.dll  c:\windows\system32\regapi.dll

rpcrt4.dll  c:\windows\system32\rpcrt4.dll

rtutils.dll  c:\windows\system32\rtutils.dll

samlib.dll  c:\windows\system32\samlib.dll

scecli.dll  c:\windows\system32\scecli.dll

secur32.dll  c:\windows\system32\secur32.dll

setupapi.dll  c:\windows\system32\setupapi.dll

shdocvw.dll  c:\windows\system32\shdocvw.dll

shell32.dll  c:\windows\system32\shell32.dll

shlwapi.dll  c:\windows\system32\shlwapi.dll

shsvcs.dll  c:\windows\system32\shsvcs.dll

tapi32.dll  c:\windows\system32\tapi32.dll

urlmon.dll  c:\windows\system32\urlmon.dll

user32.dll  c:\windows\system32\user32.dll

userenv.dll  c:\windows\system32\userenv.dll

utildll.dll  c:\windows\system32\utildll.dll

uxtheme.dll  c:\windows\system32\uxtheme.dll

version.dll  c:\windows\system32\version.dll

w32topl.dll  c:\windows\system32\w32topl.dll

winhttp.dll  c:\windows\system32\winhttp.dll

wininet.dll  c:\windows\system32\wininet.dll

winmm.dll  c:\windows\system32\winmm.dll

winscard.dll  c:\windows\system32\winscard.dll

winspool.drv  c:\windows\system32\winspool.drv

winsta.dll  c:\windows\system32\winsta.dll

wintrust.dll  c:\windows\system32\wintrust.dll

wldap32.dll  c:\windows\system32\wldap32.dll

wmi.dll c:\windows\system32\wmi.dll

ws2_32.dll  c:\windows\system32\ws2_32.dll

ws2help.dll  c:\windows\system32\ws2help.dll

wsock32.dll  c:\windows\system32\wsock32.dll

wtsapi32.dll  c:\windows\system32\wtsapi32.dll

wzcdlg.dll  c:\windows\system32\wzcdlg.dll

wzcsapi.dll  c:\windows\system32\wzcsapi.dll

wzcsvc.dll  c:\windows\system32\wzcsvc.dll

if it helps....

0

Share this post


Link to post
Share on other sites

That's odd, /? worked on SP1. Probably best to wait for SP2 then :)

0

Share this post


Link to post
Share on other sites

Yea Ill jsut manually configure it after each install untill sp2 arrives. Thanks for all the help guys

0

Share this post


Link to post
Share on other sites

To expand on what DarkBringer pointed out in his post. The power scheme is set by the CurrentPowerPolicy key:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Control Panel\PowerCfg]
"CurrentPowerPolicy"="2"            ;Power Scheme (Default="0")
                                   ; "0" = Home/Office Desk
                                   ; "1" = Portable/Laptop
                                   ; "2" = Presentation
                                   ; "3" = Always On
                                   ; "4" = Minimal Power Management
                                   ; "5" = Max Battery

The actual settings are stored as Binary values PowerPolicies\[Policy Number]\Policies key.

The Advanced and Hibernate options are stored in the following registry key:

HKEY_CURRENT_USER\Control Panel\PowerCfg\GlobalPowerPolicy\Policies

0

Share this post


Link to post
Share on other sites

@AaronXP

The one that you posted is for SP2 RC1.

There is an older one that works for SP1. I posted it some time back.

powercfg.exe

0

Share this post


Link to post
Share on other sites

see I told u there was powercfg.exe for sp1

I wasn't wrong

cause i've been using it. for a sec there i thought i've been using sp2 for a loooong time :) pfewww....

0

Share this post


Link to post
Share on other sites

ok now the question I have is. How do I change it so that when I close the lid on my computer the computer does not shut down. I dont see how to do this...

0

Share this post


Link to post
Share on other sites

I thought i would ressurect this old post - i have been having trouble finding a way to set the energy buttons (such as when I close the lid etc) state via command line but unfortunately cannot find any way of doing it as it is one of the few power options not covered in powercfg.

Anybody have any ideas yet?

0

Share this post


Link to post
Share on other sites

ok now the question I have is. How do I change it so that when I close the lid on my computer the computer does not shut down. I dont see how to do this...

Found this thread while searching for the same thing as you and 'Snife'. If I find a solution I will post it - even though this thread is over 6 years old haha. Maybe NLite has something built in..

0

Share this post


Link to post
Share on other sites

This is something I bodged a while ago - there are probably better ways, and it's been minimally tested on xp 32bit only...

' _power.vbs
Option Explicit

Const HKCU=&H80000001

Dim WshShell, fso, oReg, strLog, oLog
Dim temp, userprofile
Dim sHive, sKey, sValue, oArray, oArrayNew

set WshShell = CreateObject("WScript.Shell")
Set fso = CreateObject ("Scripting.FileSystemObject")
Set oReg=GetObject( "winmgmts:{impersonationLevel=impersonate}!\\.\root\default:StdRegProv")

temp = WshShell.ExpandEnvironmentStrings("%temp%")
userprofile = WshShell.ExpandEnvironmentStrings("%userprofile%")

strLog = temp & "\_power.txt"

if not fso.fileexists(strLog) then fso.CreateTextFile(strLog) end if
Set oLog = fso.OpenTextFile(strLog,8) '8 = ForAppending

If Wscript.Arguments.Count = 1 Then
oLog.WriteLine Now & " " & Wscript.Arguments(0)
End If

sHive = HKCU
sKey = "Control Panel\PowerCfg\GlobalPowerPolicy"
sValue = "Policies"

'do nothing when lid is closed
alter "52", "off", CInt("&H02")
alter "63", "on", CInt("&H80")
alter "64", "off", CInt("&H02")
alter "75", "on", CInt("&H80")

'dont ask for password when resume from standby
alter "172", "off", CInt("&H04")


WScript.Quit(0)

'byte array is zero based

Sub alter (iByte, action, iVal)
oReg.GetBinaryValue sHive, sKey, sValue, oArray
oArrayNew = oArray
select case action
case "on"
oArrayNew(iByte) = oArray(iByte) OR iVal
oReg.SetBinaryValue HKCU, sKey, sValue, oArrayNew
oLog.WriteLine Now & " " & iByte & " " & Hex(oArray(iByte)) & " -> " & Hex(oArrayNew(iByte))
case "off"
if ((oArray(iByte) AND iVal) = iVal) then
oArrayNew(iByte) = oArray(iByte) XOR iVal
end if
oReg.SetBinaryValue HKCU, sKey, sValue, oArrayNew
oLog.WriteLine Now & " " & iByte & " " & Hex(oArray(iByte)) & " -> " & Hex(oArrayNew(iByte))
end select
end sub

0

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

  • Recently Browsing   0 members

    No registered users viewing this page.