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


Thread Tools

Similar help and support threads
Thread Forum
Power Plan Settings - Change
How to Change Power Plan Settings in Windows 7 This will show you how to change the settings for the power plan that you have selected to reflect how you want your Windows 7 computer to manage power usage. Here's How: 1. Open the Start Menu, and type powercfg.cpl in the search...
Can a script be written to change all IE settings across a network?
Hello, we are running a 2012 server. We are on a domain. We recently received notification that advanced settings in IE need to be updated specifically in order to use their website. And something to do with a SSL. Is there a way to change all IE settings on all of the computers connected to our...
Browsers & Mail
Help needed in creating a script to change certain Windows 7 settings
Morning, afternoon and or evening ladies and gentlemen. Glad to be a part of the forums. As the title of the thread implies, I would like some help in creating a script or scripts to change a few settings in windows instantaneously with a single keystroke, command or perhaps using specific...
General Discussion
Unable to change Power settings
Hi, I have been having some issues changing the power settings on my Dell desktop running Windows 7 Ultimate. When i go into Control Panel and then into Power settings all i get is a little red circle with a x in it. Any ideas? Untitled | Flickr - Photo Sharing!
Performance & Maintenance
Power settings don't really change anything?
Hi. I had previously set my system to "Do nothing" when I physically press the power button, to avoid accidental manual shutdown. Well I was doing something and accidentaly pressed the button. The computer shutdown. I checked again under power settings, and the "Do nothing" option was indeed...
General Discussion

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 06:31.
Twitter Facebook