create sleep task, to force sleep over a program ?

stuartrozier

New member
Member
VIP
Local time
6:56 AM
Messages
113
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 Computer

Computer Manufacturer/Model Number
HP
OS
Windows 7 Home Pre 64bit
CPU
i7 intel core 2.93GHZ
Motherboard
MSI
Memory
16.00GB
Graphics Card(s)
nVidia GT 220
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 Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom Built
OS
Windows 10 Pro x64, Windows 8.1 Pro x64, Windows 7 Ultimate x64 SP1,
CPU
INTEL i9-7920X LGA 2066
Motherboard
Gigabyte X299-WU8 F3
Memory
64 GB (4 X 16 GB) G-Skill V Series DDR4 3200 Quad Channel
Graphics Card(s)
EVGA GTX 1060 SC 3 GB
Sound Card
Realtek Onboard ALC1220
Monitor(s) Displays
2 x Samsung S27E310
Screen Resolution
1920x1080
Hard Drives
Samsung 2 x 970 EVO Plus 500 GB NVMe
1 x 6TB WD 6003FZBX SATA
1 x 6TB WD 60EFRX SATA
12 x 3TB WD 30EFRX SATA
PSU
Seasonic X-1050
Case
Thermaltake Armor+
Cooling
Corsair H80i V2 Liquid AOI Cooler
Keyboard
Logitech G510s
Mouse
Logitech MX Master 2S
Internet Speed
200 Mb/s
Antivirus
ESET NOD32 13.1
Browser
EDGE (Dev, Canary, Beta), Chrome
Other Info
ASUS RT-AC68U router
Malwarebytes 4.0.4
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 Computer

Computer Manufacturer/Model Number
HP
OS
Windows 7 Home Pre 64bit
CPU
i7 intel core 2.93GHZ
Motherboard
MSI
Memory
16.00GB
Graphics Card(s)
nVidia GT 220
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 Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Toshiba Sattelite A665-S6092
OS
Windows 7 Ultimate x64
CPU
Intel Core i7-740QM
Memory
8 GB DDR3
Graphics Card(s)
NVIDIA GeForce 330GT
Screen Resolution
1366x768
Hard Drives
Samsung 840 SSD 500GB
1TB USB3 external HD
Cooling
Coolermaster Notepal U3 notebook cooling pad
Internet Speed
3mbps ASDL
Antivirus
ClamWin 0.98.7
Browser
Opera 12.17 x86 (main), Firefox 38 (sec), IE11 (last resort)
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 Computer

Computer Manufacturer/Model Number
HP
OS
Windows 7 Home Pre 64bit
CPU
i7 intel core 2.93GHZ
Motherboard
MSI
Memory
16.00GB
Graphics Card(s)
nVidia GT 220
Go to :orb: 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 Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom Built
OS
Windows 10 Pro
CPU
AMD Ryzen 5 2400G Processor with Radeon RX Vega 11 Graphics
Motherboard
ASRock X470 Master SLI/AC AM4 AMD Promontory X470 SATA 6Gb/s
Memory
G.SKILL Ripjaws V Series 16GB (2 x 8GB) 288-Pin DDR4 SDRAM D
Graphics Card(s)
2047MB NVIDIA GeForce GTX 1060 6GB (EVGA)
Sound Card
Motherboard Built in
Monitor(s) Displays
Acer R240HY bidx 23.8-Inch IPS HDMI DVI VGA (1920 x 1080) Wi
Screen Resolution
1920 x 1080
Hard Drives
1TB Sandisk SSD PLUS (Main drive)
500 GB Seagate 7200 RPM (Games)
500 GB Western Digital 7200 RPM (Virtual Machines)
PSU
CORSAIR TX Series TX650M 650W 80+ Gold Modular Power Supply
Case
CORSAIR CARBIDE SPEC-02 Mid-Tower Gaming Case, Red LED Fan
Cooling
220mm, two 120mm, and four 60mm fans
Keyboard
Wired Dell keyboard
Mouse
Wireless Logitech mouse
Internet Speed
250mb down, 30mb up
Antivirus
Panda Cloud Antivirus
Browser
Chrome-ish x64
Other Info
Your awesome for reading this.
Go to :orb: 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 Computer

Computer Manufacturer/Model Number
HP
OS
Windows 7 Home Pre 64bit
CPU
i7 intel core 2.93GHZ
Motherboard
MSI
Memory
16.00GB
Graphics Card(s)
nVidia GT 220
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
 
Last edited:

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Built at Micro Center Richardson, TX
OS
Windows 7 Home Premium 64 bit
CPU
Intel i5 650 Dual Core 3.20 GHz Cache 4MB Threads: 4
Motherboard
ASUS PRO P7P55D-E
Memory
Corsair 16GB DDR3 1600MHz 9-9-9-24 P/N: CMZ8GX3M2A1600C
Graphics Card(s)
ZOTAC GeFORCE 9500 ZT-95TEK2M-FSL 1GB GDDR2
Sound Card
Mother Bd
Monitor(s) Displays
ASUS V228H 21.5” Diag
Screen Resolution
1440 x 900
Hard Drives
SEAGATE BARRACUDA (2ea) 3.5” INTERNAL 1Tb 16 MB SATA ST1000DM003-9YN162 7200RPM, 64MB, SATA 6Gb/s ** 2 Sata Hot-Swap Racks installed in Tower
PSU
Thermaltake Model TR2 RX 750W
Cooling
2 Tower Fans
Keyboard
Dell Quietkey PS/2 Windows 104 P/N 0463CD
Mouse
Kensington Mechanical Trackball USB Model 64217
Internet Speed
35/35
Antivirus
Norton 360 & MBAM Pro
Browser
IE10
Other Info
Printer: HP DeskJet 3520 USB 2.0 **
Speakers: ALTEC Model VS4621 2.1 28 W/Channel w/Sub-woofer **
IOGEAR HDMI Monitor Switcher Swx3 MODEL GHDSW3 ** Addonics ZDRWESU3 eSata/USB 3.0 external DVD Read/Write DVD Drive** SEAGATE GoFlex USB 2.0 Portable HD 500GB 5400 RPM P/N: 9ZF2A2-570
Back
Top