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: create sleep task, to force sleep over a program ?

29 Jan 2014   #1
stuartrozier

Windows 7 Home Pre 64bit
 
 
create sleep task, to force sleep over a program ?

Hello,

I would like to know how to create a task in task scheduler , that'll force the computer into sleep over a running program.

Basically, I have some software that runs in the background called 'WD anywhere backup' and when this software is running it prevents the computer from sleeping.
I need the software to run, I cant disable it, because it backs up my computer to an external hard drive.

But someone told me it might be possible to create a sleep task, but to override this program, or exclude it ?

Many thanks in advance,

Stuart


My System SpecsSystem Spec
.
29 Jan 2014   #2
pbcopter

Windows 7 Ultimate x64 SP1, Windows 8.1 Pro x64, Windows 10 Pro x64
 
 

I'm a little confused. If you put the computer to sleep, no programs will run, including the WD backup, unless it wakes the system up.

Do you expect the WD backup to run during sleep?
My System SpecsSystem Spec
29 Jan 2014   #3
stuartrozier

Windows 7 Home Pre 64bit
 
 

Quote   Quote: Originally Posted by pbcopter View Post
I'm a little confused. If you put the computer to sleep, no programs will run, including the WD backup, unless it wakes the system up.

Do you expect the WD backup to run during sleep?

Hello, sorry

the auto sleep option in power saving options .... is set to sleep when computer is idle ... but although the computer is idle and no one is using it ... wd prevents the computer from sleeping automatically.

I have tested by closing the wd program that runs in the area next to the clock, and the auto sleep feature works and closes after 30mins.

But when the program is running, the auto sleep feature fails to work
My System SpecsSystem Spec
.

29 Jan 2014   #4
Alejandro85

Windows 7 Ultimate x64
 
 

There is a good reason for this. Once the computer goes to sleep, it will no longer work! All programs will stop executing, including your backups, which will NOT be made when sleeping (since the computer will be off).

I don't think it's hard to make such a task, but doing so will disable the backup program automatically as a side-effect. The best thing you can do is to schedule the computer to sleep a few minutes after the backup schedule time, so it backups first, then sleeps.
My System SpecsSystem Spec
30 Jan 2014   #5
stuartrozier

Windows 7 Home Pre 64bit
 
 

Quote   Quote: Originally Posted by Alejandro85 View Post
There is a good reason for this. Once the computer goes to sleep, it will no longer work! All programs will stop executing, including your backups, which will NOT be made when sleeping (since the computer will be off).

I don't think it's hard to make such a task, but doing so will disable the backup program automatically as a side-effect. The best thing you can do is to schedule the computer to sleep a few minutes after the backup schedule time, so it backups first, then sleeps.

Thankyou for quick reply,

I am actually not wanting to the WD program to run whilst asleep. I want the "auto sleep feature" to close this WD program and for the computer to go to sleep.

All im trying to get to work is the "auto sleep with idle" option when the computer is idle. But the WD program is preventing it from working as the WD program is continuously backing up in the background, it never stops.

It has a continuous synchronisation feature, which means its constantly backing up your computer, every change to a file etc.

When I close this program, the "sleep when idle" feature works ...

So ive been told its possible to create a task in task scheduler to sleep the computer even though this program is preventing it from closing, so an override trigger to be exact.

Many thanks

Stuart
My System SpecsSystem Spec
30 Jan 2014   #6
andrew129260

Windows 10 Pro
 
 

Go to type power options in the search. Click power options. Under your power plan you have set, click change plan settings. Change advanced power settings. Sleep-Allow wake timers-Choose disable. This will prevent any program from interfering with sleep as well as preventing programs from waking the pc.

You could just click start-arrow next to shutdown -sleep when you want the pc to sleep instead of waiting for it to do that.
My System SpecsSystem Spec
03 Feb 2014   #7
stuartrozier

Windows 7 Home Pre 64bit
 
 

Quote   Quote: Originally Posted by andrew129260 View Post
Go to type power options in the search. Click power options. Under your power plan you have set, click change plan settings. Change advanced power settings. Sleep-Allow wake timers-Choose disable. This will prevent any program from interfering with sleep as well as preventing programs from waking the pc.

You could just click start-arrow next to shutdown -sleep when you want the pc to sleep instead of waiting for it to do that.

Hey - I have tried this, but wd still wont let my computer sleep

I tried again quiting the program, and it slept after 5mins (as a tester) ....

I then re-enabled the wd program, and it then failed to sleep again - so frustrating lol
My System SpecsSystem Spec
19 May 2014   #8
Scoop

Windows 7 Home Premium 64 bit
 
 

If you're interested in downloading AutoHotkey, a free hotkey tool, you can use a script that will put your PC to sleep.

I've been using AutoHotkey on my Desktop PC and Laptop PC's (both Win 7 x64) for about 3 years. It's a nice tool that I use to define keys and run various scripts.

I have a script that should do what you're interested in:

Code:
 
Sleep 5000 ; comment: Not a "Sleep" standby command.  This is just a "wait" command within the script
DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0)
Exit
You can write a similar batch file for CMD but I found that it was easier for me to use the AutoHotkey DLLCALL since I'm using it anyway on both PC's.

You can also define a hotkey for Sleep mode. The following line in my startup AutoHotkey script defines the key combination <win>s to put the PC into Sleep mode (Standby). I have Hibernation disabled on my Desktop PC.


Code:
 
#s::DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0)
If you decide to use AutoHotkey on your PC, you can then create a task in Task Scheduler to run the script.

I have another script that I use to invoke Sleep unattended after a daily backup program completes. It runs with Task Scheduler at a time during the day when I'm rarely at the PC but if I am in an interactive session at that time, the script begins with a 4-count loop and plays one of the Windows media *.wav files, to let me know that the Sleep task has launched.

Then the script will play one of my .wav music tunes for a couple of minutes, then fade out like a tune on a radio. If I want to remain on my PC, I can just run Process Explorer or Task Manager and delete the process to prevent the PC from going into Sleep mode.

Here's my Sleep script:

Code:
 
SoundSet, 100
Loop, 4
{
SoundPlay, C:\Windows\Media\Afternoon\Windows Notify.wav, wait
}
SoundSet, 60
SoundPlay, C:\Users\Jeff\Documents\Music\WAV FILES\my_tune.wav
Sleep 120000
Loop, 70
{
SoundSet, -1
Sleep 375
}
Sleep 2000
DllCall("PowrProf\SetSuspendState", "int", 0, "int", 0, "int", 0)
Sleep 5000        ; Keeps sound off for 5 sec after wakeup to mute residual wav output
SoundSet, 100
Exit
My System SpecsSystem Spec
Reply

 create sleep task, to force sleep over a program ?




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Task - Create to Run a Program at Startup and Log On
How to Create a Task to Run a Program at Startup and Log On in Windows 7 This will show you how to create a task in Windows 7 Task Scheduler to run a program of your choice at the Startup and/or Log On of any user account. By default, you cannot run a elevated (Run as administrator) program...
Tutorials
Need to run a task when resuming from sleep
I have a batch file that stops and restarts a service. I'm trying to make a task to run that when the computer wakes from sleep but it doesn't run. On the history it does say the task is completed. If I click run manually it also works. I have the trigger as: Begin the task: On an event...
General Discussion
Using Task Scheduler to restart a program upon wake from sleep
I'm using Logitech's latest LGS for my G700. It's very annoying that I have to exit and restart LGS when my system comes out of sleep or LGS doesn't recognize the mouse as being awake (windows drives it then). This happens when the mouse is running wirelessly. It also happens across versions. Is...
General Discussion
When Task Manager can't force a program to close, what then please?
Hello I have been trying to open Picasa for a couple of hours now - it no longer responds when double-clicked in 'my programs', or if I right click and choose 'open' No other programs are affected and everything else works as it should. By Googling I've discovered that the program is...
General Discussion
Sleep through Task Scheduler
I did read this tutorial http://www.sevenforums.com/tutorials/12444-task-scheduler-create-new-task.html but have no success with putting my laptop to sleep automatically. May someone tell me what exactly I need to put under Actions? Do I need to make script first? because all I can choose there...
Performance & Maintenance
Task Scheduler Sleep Implementation
I want my computer to wake up every 4th hour for an hour and then go back to sleep. For example, the computer is in sleep mode and wakes up at 12AM then goes back to sleep at 1AM. Then it will repeat this and wake up at 4AM and goes back to sleep at 5AM. A total of 6 wake ups a day. Can it be...
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:34.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App