How do I prevent going to sleep with processes active?

JBDevon

New member
My normal settings are for the display to 'sleep' after 15 mins and the computer to 'sleep' after 20 mins. This is fine for day to day use but once a week and once a month a virus scan and backup are scheduled to run. It is really anoying for the computer to go to sleep whilst these are running and having to remember to set sleep never for these days. Is there a 'switch' somewhere that I am missing?
Windows 7 64 bit
 

My Computer

OS
Windows 7 64 bit
You can thank MS for W7's incredibly aggressive power savings functionality, which doesn't seem to care what the CPU is doing and goes to sleep during any program operation. Any program, that is, which does not know the "Secret Handshake" to tell W7 to leave it the heck alone (somethng called STES iirc).

Anyway if your AV program isn't smart enough to keep W7 awake (my Comodo isn't either) then you can create your own batch commands to change your Power settings (via CLI powercfg) prior to your AV running, and return the settings back to normal after. Nontrivial at best...

Here's a freeware I just found that might be of interest

http://www.ghacks.net/2010/11/21/dont-sleep-prevent-standby-hibernate-shutdown-in-windows/

And here is what Programmers need to know to make their proggies keep Windows from sleeping:

http://msdn.microsoft.com/en-us/library/aa373208%28VS.85%29.aspx

A couple other programs I found. What you want to do is to Wake your PC just prior to those dates/times when your AV is scheduled to run, then restore your Sleep settings after the AV scan is complete:

http://www.dennisbabkin.com/wosb/

http://ck-tnt.blogspot.com/2011/04/how-to-wake-up-your-pc-from-stand-by.html
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Dell Latitude E6540 Laptop
OS
Windows 7 Professional 64bit
CPU
Intel Core i7 4600M @ 2.90GHz
Motherboard
Dell Inc. 0CYT5F (SOCKET 0)
Memory
16.0GB Dual-Channel DDR3 @ 797MHz (11-11-11-28)
Graphics Card(s)
Intel HD Graphics 4600 (Dell) 2048MB ATI AMD Radeon HD 8790M
Sound Card
Realtek High Definition Audio
Monitor(s) Displays
HP ZR30w (2560x1600@60Hz)
Hard Drives
256GB LITEONIT LMT-256M6M-41 mm SATA (SSD)
1TB Samsung SSD 860 EVO mSATA SATA (SSD)
2TB USB 3.0 USB Device
115GB SanDisk Ultra Fit USB
Other Info
Multiple Dell E-Port Plus II Port Replicator/Docking Stations 0Y72NH USB 3.0 + 130W AC Adapters
What AV do you use? The reason I ask this is because some anti-virus has an option to automatically shutdown or sleep after a scan is finished.
 

My Computer

Computer Manufacturer/Model Number
Custom Build
OS
Windows 7 Ultimate x64/Windows 8 Consumer Preview x64/Ubuntu 11.04
CPU
Intel Pentium Dual Core E6700 3.2GHz
Motherboard
ASUS P5G41T-M LX
Memory
Strontium 8192MB DDR3 1333Mhz
Graphics Card(s)
msi GeForce N560GTX-M2D1GD5 1GB
Sound Card
Realtek HD Audio
Monitor(s) Displays
CHIMEI CMV 221D 22"
Screen Resolution
1680x1050
Hard Drives
Seagate Barracuda LP Green 3.5'' 2TB Internal HDD 5900RPM + WD Elements Desktop 1TB External HDD 7200RPM
PSU
SHAW Viper-1500w Gaming PSU
Case
Black eMaxx ATX Mini Tower Case
Keyboard
Microsoft Wireless Keyboard 1000
Mouse
Microsoft Wireless Optical Mouse 2000
Internet Speed
100GB @ 4.76Mbps
Hi,

I think the tool that might help you here is powercfg. You access it from an elevanted CMD window.

If you type powercfg /? in the cmd window, it will list several usage options. The one I think might be able to help you is:

powercfg -requestoverride

I have never used it, but from the description it looks like you can use a service (for example a backup service or security service) to override the sleep state (i.e. it 'wakes' the computer when the service sends a signal to start).

Code:
  -REQUESTSOVERRIDE
              Sets a Power Request override for a particular Process, Service,
              or Driver. If no parameters are specified, this command displays
              the current list of Power Request Overrides.
              Usage: POWERCFG -REQUESTSOVERRIDE <CALLER_TYPE> <NAME> <REQUEST>
              <CALLER_TYPE>    Specifies one of the following caller type:
                               PROCESS, SERVICE, DRIVER. This is obtained by
                               calling the POWERCFG -REQUESTS command.
              <NAME>           Specifies the caller name. This is the name
                               returned from calling POWERCFG -REQUESTS command.
              <REQUEST>        Specifies one or more of the following Power
                               Request Types: Display, System, Awaymode.
              Example:
                  POWERCFG -REQUESTSOVERRIDE PROCESS wmplayer.exe Display System

I'll see if one of the more experienced users can confirm or deny this, or maybe make an alternative suggestion.

Regards,
Golden
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Golden Mk. I.4
OS
Windows 10 Pro x64 ; Xubuntu x64
CPU
Intel i7 860 @ 2.80 GHz O/C'ed to 4.0GHz
Motherboard
Gigabyte P55A-UD3R Rev.1. Award BIOS F13
Memory
16GB Corsair Vengance DDR3 @ 661 MHz Dual Channel (9-9-9-24)
Graphics Card(s)
EVGA NVidia GTX 560 1024MB
Sound Card
Realtek Integrated
Monitor(s) Displays
Dual Samsung SyncMaster 2494HS
Screen Resolution
1920*1080 and 1920*1080
Hard Drives
1*Samsung 840 EVO 120GB SSD;
1*OCZ Vertex 2 60GB SSD;
2*Samsung F3 SpinPoint 1TB in RAID0;
1*Samsung F1 SpinPoint 1TB;
2*Western Digital 1TB External USB 3.0
1*Western Digital 500GB External USB 3.0
1*Seagate 500GB External USB 2.0
PSU
Thermaltake ToughPower QFan 750W
Case
Thermaltake Element S VK60001W2Z
Cooling
Corsair H60 Water Cooling, 2*230mm and 2*80mm case fans
Keyboard
Logitech G110
Mouse
Logitech MX518

My Computer

Computer Manufacturer/Model Number
Toshiba Satellite S875D-S7239 laptop
OS
MS Windows 7 Ultimate SP1 64-bit
CPU
AMD A10-4600M
Motherboard
AMD Pumori (Socket FT1)
Memory
6.00 GB Dual-Channel DDR3 @ 798MHz (11-11-12-28)
Graphics Card(s)
AMD Radeon HD 7660G
Sound Card
High Definition Audio Device
Monitor(s) Displays
Generic PnP Monitor (1600x900@60Hz)
Screen Resolution
1600x900@60Hz
Hard Drives
SSD 119GB Corsair CSSD-V128GB2 ATA Device
Keyboard
Standard PS/2 Keyboard
Mouse
HP Wireless Optical Mobile Mouse Model FHA-3410
Internet Speed
What the local pub, local coffee shop offers.
Other Info
Optical Drive:MATSHITA BD-CMB UJ160B ATA Device


Also have an Asus ha1002xp netbook with Win 7 Ultimate installed.
JB,
Would you:
:orb: | Administrative Tools | Task Scheduler | left-click on Task Scheduler Library | highlight the task in question (from the middle pane) | click on Export (right-hand pane) | Save button.

You will have saved a .xml file. Tack a .txt on to that file so that you can upload it and then upload the file.

Files and Screenshots - Upload and Post in Seven Forums
How to Upload and Post a Screenshot and File in Seven Forums
 

My Computer

Computer Manufacturer/Model Number
Toshiba Satellite S875D-S7239 laptop
OS
MS Windows 7 Ultimate SP1 64-bit
CPU
AMD A10-4600M
Motherboard
AMD Pumori (Socket FT1)
Memory
6.00 GB Dual-Channel DDR3 @ 798MHz (11-11-12-28)
Graphics Card(s)
AMD Radeon HD 7660G
Sound Card
High Definition Audio Device
Monitor(s) Displays
Generic PnP Monitor (1600x900@60Hz)
Screen Resolution
1600x900@60Hz
Hard Drives
SSD 119GB Corsair CSSD-V128GB2 ATA Device
Keyboard
Standard PS/2 Keyboard
Mouse
HP Wireless Optical Mobile Mouse Model FHA-3410
Internet Speed
What the local pub, local coffee shop offers.
Other Info
Optical Drive:MATSHITA BD-CMB UJ160B ATA Device


Also have an Asus ha1002xp netbook with Win 7 Ultimate installed.
You can thank MS for W7's incredibly aggressive power savings functionality, which doesn't seem to care what the CPU is doing and goes to sleep during any program operation. Any program, that is, which does not know the "Secret Handshake" to tell W7 to leave it the heck alone (somethng called STES iirc).
Actually, the "secret handshake" is publicly documented and a very easy-to-use API. It's probably best to lay the blame at a vendor's feet for not keeping a machine awake when it's doing something it thinks is of utmost importance, rather than blaming Microsoft's environment that has been this way since 2000 (at least). Also, other power state options are also well documented, so applications that "must" keep the system awake (and don't) are to blame in this case.

As to the OP's question, powercfg does provide the override function (as per Golden's post), which will allow a particular running process to keep a machine awake if the power plan attempts to sleep whilst that process is running. However, if the antivirus scan runs under the same process name as it's resident A/V (and not a separate process), creating an override for this process will keep the machine awake indefinitely.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom
OS
Windows 10 Pro x64
CPU
Intel Core i7 4790K @ 4.5GHz
Motherboard
Asus Maximus Hero VII
Memory
32GB DDR3
Graphics Card(s)
Nvidia GeForce GTX970
Sound Card
Realtek HD Audio
Screen Resolution
1920x1200
Hard Drives
1x Samsung 250GB SSD
4x WD RE 2TB (RAIDZ)
PSU
Corsair AX760i
Case
Fractal Design Define R4
Cooling
Noctua NH-D15
Actually, the "secret handshake" is publicly documented and a very easy-to-use API. It's probably best to lay the blame at a vendor's feet for not keeping a machine awake when it's doing something it thinks is of utmost importance, rather than blaming Microsoft's environment that has been this way since 2000 (at least). Also, other power state options are also well documented, so applications that "must" keep the system awake (and don't) are to blame in this case.
Actually it changed with Vista, but let's agree to disagree on this one--there are just way too many user problems associated with S3 such that most folks just turn it off (so much for Windows being Green). And way too many vendors whose products don't know about all these "well documented" requirements.
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Dell Latitude E6540 Laptop
OS
Windows 7 Professional 64bit
CPU
Intel Core i7 4600M @ 2.90GHz
Motherboard
Dell Inc. 0CYT5F (SOCKET 0)
Memory
16.0GB Dual-Channel DDR3 @ 797MHz (11-11-11-28)
Graphics Card(s)
Intel HD Graphics 4600 (Dell) 2048MB ATI AMD Radeon HD 8790M
Sound Card
Realtek High Definition Audio
Monitor(s) Displays
HP ZR30w (2560x1600@60Hz)
Hard Drives
256GB LITEONIT LMT-256M6M-41 mm SATA (SSD)
1TB Samsung SSD 860 EVO mSATA SATA (SSD)
2TB USB 3.0 USB Device
115GB SanDisk Ultra Fit USB
Other Info
Multiple Dell E-Port Plus II Port Replicator/Docking Stations 0Y72NH USB 3.0 + 130W AC Adapters
I think the tool that might help you here is powercfg.
Hmmm I think I said that. ;)

Depends on the program, but for some I create a batch file that just does this:
Code:
powercfg -change -standby-timeout-ac 0
powercfg -change -hibernate-timeout-ac 0
powercfg -change -monitor-timeout-ac 1

CALL whatever process you want

powercfg -change -standby-timeout-ac 30
powercfg -change -hibernate-timeout-ac 30
powercfg -change -monitor-timeout-ac 5
For my Comodo Internet Security weekly AV scans, I use Task Scheduler to wake the computer and do the above "change to 0" then 2 hours later put the settings back via "change to 30" which is plenty of time for the AV scan to complete.

No fun, but it works.
 

My Computer

Computer type
Laptop
Computer Manufacturer/Model Number
Dell Latitude E6540 Laptop
OS
Windows 7 Professional 64bit
CPU
Intel Core i7 4600M @ 2.90GHz
Motherboard
Dell Inc. 0CYT5F (SOCKET 0)
Memory
16.0GB Dual-Channel DDR3 @ 797MHz (11-11-11-28)
Graphics Card(s)
Intel HD Graphics 4600 (Dell) 2048MB ATI AMD Radeon HD 8790M
Sound Card
Realtek High Definition Audio
Monitor(s) Displays
HP ZR30w (2560x1600@60Hz)
Hard Drives
256GB LITEONIT LMT-256M6M-41 mm SATA (SSD)
1TB Samsung SSD 860 EVO mSATA SATA (SSD)
2TB USB 3.0 USB Device
115GB SanDisk Ultra Fit USB
Other Info
Multiple Dell E-Port Plus II Port Replicator/Docking Stations 0Y72NH USB 3.0 + 130W AC Adapters
Karlsnooks

Thanks for reply. First time I've gone into Task Scheduler, interesting!
Seems McAfee must use its own scheduler as it does not appear in the list. I am using McAfee version 11.0.578 and Virusscan ver 15.0.291 which runs every friday.

The other 'problem program' is standard Windows backup, set to run on the 1st of the month. There appears to be 3 entries for backup? I will upload a file if you still need it.
 

My Computer

OS
Windows 7 64 bit
Actually it changed with Vista, but let's agree to disagree on this one--there are just way too many user problems associated with S3 such that most folks just turn it off (so much for Windows being Green). And way too many vendors whose products don't know about all these "well documented" requirements.
Yes, it changed with Vista because anything using the CPU or memory for any length of time would keep the system awake (amongst other things), whereas that isn't necessarily the proper way to handle sleep (even the OS can do this). Hence sleep wasn't used as much as it should/would have been, and it was far harder to determine what or when a machine would sleep. I will agree to disagree, but any app that hasn't gotten the hint since 2005 (Vista betas where this was first seen) might simply need to be considered for replacement if possible.
 

My Computer

Computer type
PC/Desktop
Computer Manufacturer/Model Number
Custom
OS
Windows 10 Pro x64
CPU
Intel Core i7 4790K @ 4.5GHz
Motherboard
Asus Maximus Hero VII
Memory
32GB DDR3
Graphics Card(s)
Nvidia GeForce GTX970
Sound Card
Realtek HD Audio
Screen Resolution
1920x1200
Hard Drives
1x Samsung 250GB SSD
4x WD RE 2TB (RAIDZ)
PSU
Corsair AX760i
Case
Fractal Design Define R4
Cooling
Noctua NH-D15
Karlsnooks

Thanks for reply. First time I've gone into Task Scheduler, interesting!
Seems McAfee must use its own scheduler as it does not appear in the list. I am using McAfee version 11.0.578 and Virusscan ver 15.0.291 which runs every friday.

The other 'problem program' is standard Windows backup, set to run on the 1st of the month. There appears to be 3 entries for backup? I will upload a file if you still need it.
Now this is personal preference, although actually the majority of the people working this forum will agree with me. Dump those two. My replacement choice is Microsoft Security Essentials (MSE) link in my sig.

There are those who bought and swear by DeSoto (or are you too young for that one). We all make our choices. I like quality, reliability, small footprint, complete compatibility with Windows. Maybe with the buyout of Muckafee (oops that was supposed to be McAfee) then the product will improve. Lately they've not been enjoying the highest respect and admiration from the software community.

If you check out all of the entries in the left-hand pane, you will probably find an entry for your av software.
 

My Computer

Computer Manufacturer/Model Number
Toshiba Satellite S875D-S7239 laptop
OS
MS Windows 7 Ultimate SP1 64-bit
CPU
AMD A10-4600M
Motherboard
AMD Pumori (Socket FT1)
Memory
6.00 GB Dual-Channel DDR3 @ 798MHz (11-11-12-28)
Graphics Card(s)
AMD Radeon HD 7660G
Sound Card
High Definition Audio Device
Monitor(s) Displays
Generic PnP Monitor (1600x900@60Hz)
Screen Resolution
1600x900@60Hz
Hard Drives
SSD 119GB Corsair CSSD-V128GB2 ATA Device
Keyboard
Standard PS/2 Keyboard
Mouse
HP Wireless Optical Mobile Mouse Model FHA-3410
Internet Speed
What the local pub, local coffee shop offers.
Other Info
Optical Drive:MATSHITA BD-CMB UJ160B ATA Device


Also have an Asus ha1002xp netbook with Win 7 Ultimate installed.
Karl

Too young! I'm what's known as a silver surfer having grown up with CP/M 8, Vax's and Cray's but that's another story.

So far Muckafee has done the job for me (and so less intrusive than Norton) that I've never needed to look at alternatives. As to backup, I've used several in the past but by the time I need it (changing machines for example) I've lost (misplaced!) the boot disk which probably wouldn't work on the new system anyway so have stuck with MS. At least there (should) be some continuity between upgrades.

Had a look again at Task Scheduler, lots of interesting stuff I shall be following up but no McAfee. Only 'folders' are Apple, Microsoft and WPD and nothing McAfee in them.

Will be looking at MSE
 

My Computer

OS
Windows 7 64 bit
Of those, the only one I missed out on was Cray. Ah, for the good old days when computers were computers taking up ten thousand as much space and using ten thousand as many watts (and these are very conservative niumbers).

Iif you find a magic wand to wave over your problem let me know. None of my compadres use McAfee so I don't have a system which I can investigate.
 

My Computer

Computer Manufacturer/Model Number
Toshiba Satellite S875D-S7239 laptop
OS
MS Windows 7 Ultimate SP1 64-bit
CPU
AMD A10-4600M
Motherboard
AMD Pumori (Socket FT1)
Memory
6.00 GB Dual-Channel DDR3 @ 798MHz (11-11-12-28)
Graphics Card(s)
AMD Radeon HD 7660G
Sound Card
High Definition Audio Device
Monitor(s) Displays
Generic PnP Monitor (1600x900@60Hz)
Screen Resolution
1600x900@60Hz
Hard Drives
SSD 119GB Corsair CSSD-V128GB2 ATA Device
Keyboard
Standard PS/2 Keyboard
Mouse
HP Wireless Optical Mobile Mouse Model FHA-3410
Internet Speed
What the local pub, local coffee shop offers.
Other Info
Optical Drive:MATSHITA BD-CMB UJ160B ATA Device


Also have an Asus ha1002xp netbook with Win 7 Ultimate installed.
Back
Top