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 do I prevent going to sleep with processes active?


09 Sep 2011   #1

Windows 7 64 bit
 
 
How do I prevent going to sleep with processes active?

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

09 Sep 2011   #2

Windows 7 Home Premium 64bit 6.1 Build 7601 (SP1)
 
 

You can thank MS for Windows 7'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 Windows 7 to leave it the heck alone (somethng called STES iirc).

Anyway if your AV program isn't smart enough to keep Windows 7 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/don...wn-in-windows/

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

http://msdn.microsoft.com/en-us/libr...8VS.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/h...-stand-by.html
My System SpecsSystem Spec
09 Sep 2011   #3

Windows 7 Ultimate x64/Windows 8 Consumer Preview x64/Ubuntu 11.04
 
 

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


09 Sep 2011   #4

Microsoft Community Contributor Award Recipient

Windows 7 Ult. x64 Windows 8.1 x64
 
 

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 System SpecsSystem Spec
09 Sep 2011   #5

MS Windows 7 Ultimate SP1 64-bit
 
 

My System SpecsSystem Spec
09 Sep 2011   #6

MS Windows 7 Ultimate SP1 64-bit
 
 

JB,
Would you:
| 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 System SpecsSystem Spec
09 Sep 2011   #7

Windows Server 2008 R2
 
 

Quote   Quote: Originally Posted by maxseven View Post
You can thank MS for Windows 7'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 Windows 7 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 System SpecsSystem Spec
09 Sep 2011   #8

Windows 7 Home Premium 64bit 6.1 Build 7601 (SP1)
 
 

Quote   Quote: Originally Posted by cluberti View Post
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 System SpecsSystem Spec
09 Sep 2011   #9

Windows 7 Home Premium 64bit 6.1 Build 7601 (SP1)
 
 

Quote   Quote: Originally Posted by Golden View Post
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 System SpecsSystem Spec
09 Sep 2011   #10

Windows 7 64 bit
 
 

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

 How do I prevent going to sleep with processes active?




Thread Tools




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 10:23 AM.
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