Kaseya Community

Windows Hibernation

  • I have been searching for a script that will turn off hibernation on workstation. Has anyone found one that works?


    Legacy Forum Name: Windows Hibernation,
    Legacy Posted By Username: dholliman
  • Hi dholliman,

    This is very easy to do on Windows XP SP2 machines by running the following command:

    POWERCFG.EXE /HIBERNATE OFF

    On earlier versions of Windows, however, modifying hibernate option state is tricky. In the registry the value that affects the setting is binary and even if you manage to modifyit that won't be enough because there is theHIBERFIL.SYS in the root of your drive to consider.

    See the following: http://support.microsoft.com/?kbid=293399

    An easier way around this might be to leave hibernation option enabled and simply pick a power scheme where the "System hibernates" option is set to "Never" instead of a time limit.

    This can be done by having a script modify the HKCU hive as explained here:

    http://www.winguides.com/registry/display.php/1106

    Please note that this will only affect the power settings for the user who is logged on at the time the script is ran.

    -Ed








    Legacy Forum Name: System Administration Scripts,
    Legacy Posted By Username: bellcpa
  • See this post.Its not exactly what you are asking for,but it did work for us.



    http://www.kaseya.com/kforum/view_topic.php?id=221&forum_id=15




    Legacy Forum Name: System Administration Scripts,
    Legacy Posted By Username: rmccoy@layer3.biz
  • Thanks bellcpa and rmccoy!! I will investiage and test both of your suggestions.


    Legacy Forum Name: System Administration Scripts,
    Legacy Posted By Username: dholliman
  • You should also note that I've had pretty good success on XP SP1, XP, and Windows 2000 Systems with copying the Powercfg.exe file over from an XP SP2 machine and using it. With this you should be able to push the file out to the system and then run it with the proper command.

    Legacy Forum Name: System Administration Scripts,
    Legacy Posted By Username: Jonathan
  • bellcpa wrote:

    This can be done by having a script modify the HKCU hive as explained here:

    http://www.winguides.com/registry/display.php/1106

    Please note that this will only affect the power settings for the user who is logged on at the time the script is ran.









    Here is my "registry" based power script- it will set the default power configuration to allways on- (which should eliminated hibernation/sleepmode). It's not as flexible as the command line base scripts but this will work on users that are not administrators. It's really small so (after testing it) I would schedule it to run every 3 hours on every machine for a day or two just to make sure you hit all the logins. Any new profiles created later should have the "always on" as their default power mode- I haven't confirmed this..

    ,.,.,.,.,.,.,

    Script Name: Power-Registry
    Script Description:

    IF True
    THEN
    Set Registry Value
    Parameter 1 : HKEY_CURRENT_USER\Control Panel\PowerCfg\CurrentPowerPolicy
    Parameter 2 : 3
    Parameter 3 : REG_SZ
    OS Type : 0
    Set Registry Value
    Parameter 1 : HKEY_USERS\.DEFAULT\Control Panel\PowerCfg\CurrentPowerPolicy
    Parameter 2 : 3
    Parameter 3 : REG_SZ
    OS Type : 0
    ELSE

    ,.,.,.,.,.,.,.,.,


    Legacy Forum Name: System Administration Scripts,
    Legacy Posted By Username: sean kubin