Script to change power settings


  1. Posts : 5
    Windows 7 32 Bit
       #1

    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 Computer


  2. Posts : 6,668
    Windows 7 x64
       #2

    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 Computer


  3. Posts : 5
    Windows 7 32 Bit
    Thread Starter
       #3

    Thanks that worked!
      My Computer


 

  Related Discussions
Our Sites
Site Links
About 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 15:11.
Find Us