Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.

Windows 7: Script to change power settings

21 Jun 2011   #1

Windows 7 32 Bit
Script to change power settings


I am attempting to temporarily disable hibernate and make sure the monitor doesn't go off while I am running a script to complete system configuration.

control powercfg.cpl -monitor-timeout-ac 30
control powercfg.cpl -monitor-timeout-dc 30
control powercfg.cpl /hibernate off
I believe the code above should work, but what's happening is the control panel applet for power settings is launching when this script runs.

Can someone help me make this so that:
  • The control panel applet doesn't launch
  • The settings are only made for the current logged on user

I also would appreciate knowing how to revert the setting changes I made at the end of my script


My System SpecsSystem Spec
21 Jun 2011   #2

Microsoft Community Contributor Award Recipient

Windows 7 x64

Well you are calling on the .cpl so it is going to open.
Have you tried using the old powercfg.exe method instead?
I don't believe it opens a window on execution
Just go into command window and type powercfg.exe /?
for the list of switches for it.
My System SpecsSystem Spec
21 Jun 2011   #3

Windows 7 32 Bit

Thanks that worked!
My System SpecsSystem Spec

 Script to change power settings

Thread Tools

Similar help and support threads for2: Script to change power settings
Thread Forum
Power Plan Settings - Change Tutorials
change power settings based on location Performance & Maintenance
Unable to change Power settings Performance & Maintenance
Run Script on Battery/Critical Power Performance & Maintenance
Power settings don't really change anything? General Discussion
Change power settings based on a schedule? Performance & Maintenance

Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 10:48 PM.
Twitter Facebook Google+

Windows 7 Forums

Seven Forums Android App Seven Forums IOS App