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?

18 Jul 2010   #11

Win7 / XP
 
 

I'm on a different PC now but I'll look at the idle options - seems like I did look at that before.

The other option I'm thinking is adding "sleep" into the script you gave me. That way I can pin the script/executable onto the taskbar and when my wife wants to put the pc to sleep, she can click on the executable instead of the windows icon.

You don't have any idea as to how to modify the script so that it will minimize the windows and ALSO put the pc to sleep, do you? I'm going to do some googling as well.

Thanks again for your help!

My System SpecsSystem Spec
.

18 Jul 2010   #12

Win 7 Ultimate 32bit
 
 

I was also thinking that you can try creating a Task for Idle time that calls this file to run it instead of using Power Management.

Also, this should work on PowerShell 2.0 on XP SP3, Vista and 7.
But has only been tested on 7.

Ok, I think, according to this...
"How To Put the System into hibernation or Standby from Run menu"

If hibernation is enabled, then the system will hibernate (this can be a better thing)
If it is disabled, the system will sleep.
That is, if I am reading right. Anyway....

Let me know if this works for you or not.

Download the MinWin&Suspend.exe file and run it,,, that's all you have to do.

The following 2 files are extracted and run...

Start.cmd
Code:
start /min powershell -executionpolicy remotesigned -file "%userprofile%\desktop\MinWin&Suspend.ps1"
and then

MinWin&Suspend.ps1
Code:
$shell = new-object -comobject shell.application
$shell.minimizeall()
Start-Sleep -s 5
rundll32 powrprof.dll,SetSuspendState
*****************************
MD5: BED1E28250F6B2407EE9F3647541573B
My System SpecsSystem Spec
21 Jul 2010   #13

Win7 / XP
 
 

Thanks Tepid. Haven't had a chance to try it but will let you know what happens. I really appreciate the help and suggestions!

PS - right on with the tags on the bottom of your messages!
My System SpecsSystem Spec
.


03 Dec 2013   #14

Windows 7 Home Premium 64 bit
 
 

[QUOTE=Tepid;845071]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 used this VBS script to create a task scheduled at a specific time. I need to tear myself away from my computer to go to bed so I set it up to minimized all windows every 1 minute - the triggers repeat every five minutes for an hour, but I set up five triggers at 9:40, 9:41, 9:42 etc.

I really appreciate the script - I need something that is annoying but that I can still work through for a few minutes if I have to finish up.
My System SpecsSystem Spec
15 Dec 2013   #15

win7 64bit Ult. using: XP Mode, in English or Español, SUA, Bitlocker
 
 

Possibly alternate suggestion:

As a safeguard, disable the sleep button in the startup menu. Tutorial: Sleep : Disable in Shut Down Menu

Or possibly a better way to disable the sleep button is to go to the Power Options screen | Change Plan Settings | Change Advanced Power Settings (lower left). There will be a little dialog that pops up. Scroll down to 'Power Buttons and lid', and adjust the 'Sleep Button Action' accordingly - Do Nothing.

The computer does not have to sleep immediately before she leaves it, I'm thinking(??) For example, maybe you can have the task scheduler start a daily task- to run a script posted above in this thread at a certain time.... possibly at 12:00 or whatever. The script will minimize all windows (show desktop), then it puts the computer to sleep.

ETA: Kudos to the above posters who suggest commands to put the computer to sleep. Apparently it's not that easy of a task. Something you would think is simple at first glance, isn't.

Note: Then if you have time, try to find a command that will stop all network traffic before it puts the computer to sleep. These days, they have USBs that are available for charging even when the computer is sleeping. This means that to me that the computer is NOT sleeping like it used to... It's still 'on' in a sense. You get the picture.
My System SpecsSystem Spec
16 Dec 2013   #16

win7 64bit Ult. using: XP Mode, in English or Español, SUA, Bitlocker
 
 

You may need two jobs in Task Scheduler - one after the other. Here is how to make two little programs. One to show desktop, and the other to put the computer into sleep mode:
-------------

From http://www.wikihow.com/Make-the-Show...Launch-Toolbar

Show the Desktop, type these file lines into a somename.scf file:

[Shell]
Command=2IconFile=explorer.
exe,3
[Taskbar]
Command=ToggleDesktop

..that will show the desktop / minimize all windows.

==========================================

From: http://answers.microsoft.com/en-us/w...a-290b3dea1ffb

Then to sleep, use this in a .bat file. Follow the next three steps to create this.

1) Make a somename.bat file.

2) paste the next three lines into it... save

Echo On
Rundll32.exe Powrprof.dll,SetSuspendState Sleep
Exit

3) run it.

Need to add the Sleep argument/word at the end of the line above.

Some users say that it puts their computer into hibernate mode, not sleep. May have to disable Hibernation. Worked for me though.

Hope this helps.
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 for2: How can I set a scheduled task to minimize open windows before sleep?
Thread Forum
Scheduled Task history indicates task completed successfully but.... Performance & Maintenance
Scheduled Task / Batch Code on Windows Server 2008 R2 SP1 Software
windows 7 scheduled task remote access Network & Sharing
Scheduled task does not run General Discussion
Scheduled task problems Performance & Maintenance
wish I could minimize ALL when multiple windows open in same program General Discussion
Unable to minimize, maximize, or close open windows 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 01:05 PM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33