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: How can I set a scheduled task to minimize open windows before sleep?

15 Jul 2010   #1
timber

Win7 / XP
 
 
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 System SpecsSystem Spec
.
15 Jul 2010   #2
JamesR404

Windows 7
 
 
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 System SpecsSystem Spec
15 Jul 2010   #3
timber

Win7 / XP
 
 

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 System SpecsSystem Spec
.

15 Jul 2010   #4
Tepid

Win 7 Ultimate 32bit
 
 

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 System SpecsSystem Spec
17 Jul 2010   #5
timber

Win7 / XP
 
 

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 System SpecsSystem Spec
17 Jul 2010   #6
Bill2

Windows 7 x64 pro/ Windows 7 x86 Pro/ XP SP3 x86
 
 

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 System SpecsSystem Spec
17 Jul 2010   #7
Tepid

Win 7 Ultimate 32bit
 
 

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 System SpecsSystem Spec
17 Jul 2010   #8
timber

Win7 / XP
 
 

Thanks much Tepid & Bill - I will try your suggestions.
My System SpecsSystem Spec
17 Jul 2010   #9
timber

Win7 / XP
 
 

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 System SpecsSystem Spec
17 Jul 2010   #10
Tepid

Win 7 Ultimate 32bit
 
 

Did you try the Idle options under the Conditions Tab?
My System SpecsSystem Spec
Reply

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




Thread Tools




Similar help and support threads
Thread Forum
The scheduled task are executed even if Windows is started in safe mod
Hi In Windows 7 SP1, the scheduled tasks, run at system startup, are executed even if Windows is started in safe mode? Thanks Bye
General Discussion
Scheduled Task history indicates task completed successfully but....
Hi, New here. I'm using a Scheduled Task to fire a very simple bat file that pulls, compresses and pushes a set of files to a different network directory. The bat file runs fine manually. On a networked desktop I have set up the task to run at about 5am est (waking the machine), as highest...
Performance & Maintenance
Scheduled Task / Batch Code on Windows Server 2008 R2 SP1
I have some processes that I need to stop and restart each morning. In order to do this, I've created 2 scheduled tasks inside Task Scheduler: 1.) Stop Foobar (Both Environments) - Triggers @ 6:45 AM Every Day 2.) Start Foobar (Both Environments) - Triggers @ 6:48 AM Every Day Both tasks...
Software
windows 7 scheduled task remote access
I recently upgraded my system to Windows 7 and I am unable to access scheduled taks on my remote servers. Before when I was running off win XP i had no problem with this. But now, even when opening up share folders on all my servers, i dont see the scheduled task folder; however, when i check on a...
Network & Sharing
wish I could minimize ALL when multiple windows open in same program
I really like aspects of the new taskbar, especially pinning program icons to it. I always would open my main program's in the same order so they would be in the same place on taskbar, but if I had to close one and reopen... oh well. so 7 fixed that problem, BUT. If I have multiple windows...
General Discussion
Unable to minimize, maximize, or close open windows
I have this weird and annoying problem that wont go away. If i have ANY window open (windows explorer, internet explorer, etc.) i am unable to minimize, maximize, or close the window by clicking in the upper-right corner of any of the windows. Can someone please help me out because it is...
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 19:08.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App