How do I prevent going to sleep with processes active?

Page 1 of 2 12 LastLast

  1. Posts : 3
    Windows 7 64 bit
       #1

    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 Computer


  2. Posts : 848
    Windows 7 Home Premium 64bit 6.1 Build 7601 (SP1)
       #2

    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/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 Computer


  3. Posts : 8,398
    Windows 7 Ultimate x64/Windows 8 Consumer Preview x64/Ubuntu 11.04
       #3

    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


  4. Posts : 19,384
    Windows 10 Pro x64 ; Xubuntu x64
       #4

    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

  5.   My Computer


  6. Posts : 10,200
    MS Windows 7 Ultimate SP1 64-bit
       #6

    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 Computer


  7. Posts : 2,528
    Windows 10 Pro x64
       #7

    maxseven said:
    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


  8. Posts : 848
    Windows 7 Home Premium 64bit 6.1 Build 7601 (SP1)
       #8

    cluberti said:
    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


  9. Posts : 848
    Windows 7 Home Premium 64bit 6.1 Build 7601 (SP1)
       #9

    Golden said:
    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


  10. Posts : 3
    Windows 7 64 bit
    Thread Starter
       #10

    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


 
Page 1 of 2 12 LastLast

  Related Discussions
Our Sites
Site Links
About 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 14:52.
Find Us