How can I set a scheduled task to minimize open windows before sleep?

Page 1 of 2 12 LastLast

  1. Posts : 55
    Win7 / XP
       #1

    How can I set a scheduled task to minimize open windows before sleep?


    I would like to set up a scheduled task that will minimize all open windows when I choose sleep or hibernate from the start menu.

    For some reason, if I don't minimize any open windows before entering "sleep" mode, I get screen freezes and video card errors upon awakening. I would just like to have Task Scheduler automatically minimize open windows in case my wife forgets to do so.

    The machine is a Toshiba A300 laptop that I've upgraded to Windows 7 32 bit from Vista.
      My Computer


  2. Posts : 43
    Windows 7
       #2

    A workaround?


    Try disabling Windows Aero and see if that resolves the issue.

    If you want to minimize everything before going to standby... well, maybe you can take the habit of pressing Windowskey+M every time you leave your computer (you can reverse it with Windowskey+M+shift).
      My Computer


  3. Posts : 55
    Win7 / XP
    Thread Starter
       #3

    I tried turning off Aero (but will try again). At this point I've tried everything including 3 installs of Win7, all sorts of new (and old) video drivers, power settings, and so on. Minimizing windows before sleeping is the only thing that has worked.

    The reason I want to automate the windows minimization is that it is my wife's PC and she doesn't always remember to do this. If it were just me, it would not be a problem.

    There must be some sort of scheduled task that I could set up to minimize windows whenever sleep or hibernate is invoked.
      My Computer


  4. Posts : 1,403
    Win 7 Ultimate 32bit
       #4

    This should work....

    Code:
    Set shell = wscript.CreateObject("Shell.Application")
    Shell.MinimizeAll
    paste that to a text file and then name it whatever.vbs
    Create a task that calls the file,, should work.

    Let us know if not, it may need some refining on the commands in the Task itself, to call the vbs file properly. I have not used it in 7, but it works when double clicked


    I found this somewhere a long time ago.
    I have used it before,, but not in a while. I haven't had a need for it in some time.
      My Computer


  5. Posts : 55
    Win7 / XP
    Thread Starter
       #5

    Hi Tepid - script works great - but now was wondering if you or anyone knows how to set it up under task scheduler so that it gets invoked upon sleep. I don't see an obvious task name like "sleep" listed as an option under "triggers", though presumably there are other things that happen before sleep that I could use as a trigger instead.

    Thanks much!

    Tim
      My Computer


  6. Posts : 5,056
    Windows 7 x64 pro/ Windows 7 x86 Pro/ XP SP3 x86
       #6

    If I am not mistaken, windows generates a kernel power event with the ID 42 when entering sleep. So what you can try is, in task scheduler, under triggers, select "On Event", then specify 42.
      My Computer


  7. Posts : 1,403
    Win 7 Ultimate 32bit
       #7

    Yeah I might try the Event ID 42

    The Log is System
    Source is Kernel-Power
    Event ID is 42

    I would also set the Stop task if it runs longer than 30 min just incase something causes it to run away

    or

    Under Conditions Tab,, you can try using Idle options.
      My Computer


  8. Posts : 55
    Win7 / XP
    Thread Starter
       #8

    Thanks much Tepid & Bill - I will try your suggestions.
      My Computer


  9. Posts : 55
    Win7 / XP
    Thread Starter
       #9

    Hmm - doesn't seem to be working. I think the event 42 doesn't happen until it is too late for the task to be executed.
      My Computer


  10. Posts : 1,403
    Win 7 Ultimate 32bit
       #10

    Did you try the Idle options under the Conditions Tab?
      My Computer


 
Page 1 of 2 12 LastLast

  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 06:44.
Find Us