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
mrlaconic

Windows 7 32 Bit
 
 
Script to change power settings

Greetings,

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.

Code:
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

Thanks!


My System SpecsSystem Spec
.

21 Jun 2011   #2
Maguscreed

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
mrlaconic

Windows 7 32 Bit
 
 

Thanks that worked!
My System SpecsSystem Spec
.


Reply

 Script to change power settings




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...
Tutorials
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
Cannot see Multimedia Settings under "Change advanced power settings"
I have already clicked "Change settings that are currently available" but it still does not show it, restarted the PC and still same result. MSE disabled Windows 7 Starter 32-bit Power Plan: High Performance System Model: HP Mini 110-3500
General Discussion
change power settings based on location
Hi is there anyway to automatically switch power setting based on my location. Say if I'm connected to my home network be in high performance mode. Or perhaps a program that does this? If not does anyone know how I might go about creating one ( I'm a computer science student) thanks, Laurie
Performance & Maintenance
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 12:13.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App