#123275 - 2004-07-20 06:28 AM
Re: Changing power mgmt settings (monitor)
|
Allen
KiX Supporter
Registered: 2003-04-19
Posts: 4548
Loc: USA
|
Some time ago I was looking into do the very same thing, but as it turned out, the issue was dropped and we never needed a solution. The best link/info I found, albeit Win2k, was here: Windows 2000 Power Options Always On Registry setting (The suggestions are down the page a little ways.)
Hope this helps.
|
Top
|
|
|
|
#123278 - 2004-07-21 02:55 PM
Re: Changing power mgmt settings (monitor)
|
Shawn
Administrator
Registered: 1999-08-13
Posts: 8611
|
Update:
Finally broke-down and opened-up a premier support ticket on this issue. Mostly so that I could hopefully get my hands on this rumored Windows XP version of powercfg.exe.
Talked with a very knowledgable MS "server" dude in Dallas by the name of John, and told him our woes, he was very sympathetic. I mentioned the "two" approaches I have been talking up till now, to set power settings on the user's behalf (in an automated fashion). One being a rather large REGPOKE (12k in total) that needed a machine restart to take effect, and the other being this rumored POWERCFG.EXE that is only available in XP SP2 and Windows Server 2K3.
John went right for the "powercfg.exe" approach. I told John that I tried the 2K3 version of powercfg.exe but was getting DLL errors with it on Windows XP Sp1. After much tippy-tapping on his keyboard, and hmmming and hahhhing, he said he found an "older" version of powercfg.exe on his internal MS tools share.
He mailed it to me and I must say, its a beautiful thing. I have appended the cmdline help to this post. I told John that I also heard tell that this tool required at least Power User priviledge to run. Sure enough, I ran it as a user and got a priviledge violation. All was not lost - I remembered reading Al_Po's thread about the trick to getting this working. Have to change the permissions on one HKLM registry to Users FullControl ... heres the key:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Controls Folder\PowerCfg
Soon as you do that, run powercfg.exe and Bob's your uncle. And it doesn't even require a logoff or restart! You now can fully manage all the power settings on the wkstn from your login script. By the way, before this MS tool there was a third-party package that was for sale, that did this very thing ...
Anyway, for anyone deploying new wkstns going-forward - might be wise to preset this key and slap in this powercfg.exe tool as some insurance.
-Shawn
Code:
E:\>powercfg.exe /?
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] | /?]
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 Turns the hibernation feature on/off. Hibernation timeout
is not supported on all systems that support hibernation
/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} Displays or configures the specified
battery alarm. Using this option without any switches will
display the current settings.
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 whether the system will run a program
when the alarm goes off. When this option is used,
the output will be the taskname that can be used
with schtasks.exe /change to configure the program.
/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
Hope this helps someone down-the-road.
-Shawn
|
Top
|
|
|
|
#123283 - 2005-05-02 03:30 PM
Re: Changing power mgmt settings (monitor)
|
BentWookie
Lurker
Registered: 2005-05-02
Posts: 2
|
Shawn, Is there a way for you to send me the "older" powercfg.exe? I need to change the power settings on XP SP1 computers and the powercfg.exe from SP2 won't work. Thanks
|
Top
|
|
|
|
#123289 - 2006-04-23 03:28 PM
Re: Changing power mgmt settings (monitor)
|
rohm
Fresh Scripter
Registered: 2002-07-11
Posts: 7
|
Hi,
did you get the file "powercfg.exe" for the XP SP1 version. iīm also looking for this file, but i canīt find it anywhere. i hope you can send it to me also. please send it to frank.rohm@gmx.de
thanks from frank
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 236 anonymous users online.
|
|
|