How to wake up PC from hibernate at specific time with monitors turned on?

Discussion in 'Operating Systems' started by Kulagin, Nov 29, 2019.

  1. Kulagin

    Kulagin Member

    Messages:
    48
    Likes Received:
    3
    GPU:
    R9 280X
    When I hibernate my PC and schedule a task to wake it up at a specific time:
    [​IMG]
    [​IMG]
    [​IMG]
    [​IMG]

    It wakes up PC with monitors turned off. Even if I hibernate PC manually and only a minute passes between hibernation and waking up, it still wakes up with monitors turned off. I would like it to wake up from hibernation with monitors turned on.

    I also tried to set to never turn off display in power plan:
    [​IMG]

    If I press on shut down button when PC is hibernating, it wakes up from hibernate mode and logs in automatically with monitors enabled, as expected.

    Any ideas? I'm on Windows 10 1809, AMD Radeon 280x video card, latest video drivers.
     
    Last edited: Nov 29, 2019
  2. Watcher

    Watcher Ancient Guru

    Messages:
    2,695
    Likes Received:
    367
    GPU:
    Asus Dual RX6700 XT
  3. Caesar

    Caesar Ancient Guru

    Messages:
    1,558
    Likes Received:
    682
    GPU:
    RTX 4070 Gaming X
    How to Disable Hybrid Sleep/Hibernation in Windows
    The first step is to disable hybrid sleep and/or hibernation on your computer. Why would you want to do this?

    Hibernate is a power-saving feature that saves your machine’s state (including unsaved documents, program states, etc.) onto your primary hard disk instead of onto the RAM (as sleep does.) The tradeoff is slower resume time, but less power draw. This is important for laptops with batteries, but not so much for desktops. Hybrid sleep does both—it saves open documents and application states into the memory and the hard disk. This is so you won’t lose anything in case of a power outage.

    But the real issue is that sometimes, hybrid sleep/hibernation can interfere with an automated wake script, depending on your configuration. In my case, waking from hibernation from a script only half worked—the computer would turn on, the fans would spin, and I’d get stuck on the “Resuming Windows” screen forever. If you have similar problems, you might just want to disable hibernation/hybrid sleep altogether. Here’s how:

    Open a command prompt as an administrator. To do this in Windows 7, click the Start button, type Cmd and then right-click cmd.exe and choose Run as administrator.

    [​IMG]

    Type powercfg -h off and press Enter.

    [​IMG]

    If the command was successful, then you’ll get no error messages.

    If you get the error message: “You do not have permission to enable or disable the Hibernate feature” then re-read the previous step about running cmd.exe as an administrator.

    Now, like a bear addicted to espresso, your computer will no longer hibernate. It’ll sleep, but it won’t hibernate. Mission accomplished.

    For more information on Hibernation vs. Sleep, read this write-up that Austin did on the subject: Understanding Your PC And Devices, Sleep VS. Hibernate [groovyTips]

    How to Create a Batch (.bat) File to Put Your Computer to Sleep
    The way we’ll put your computer to sleep is by running a script (.bat) that will initiate the sleep command. By using a batch file, you can add other parameters and commands to it later without rejiggering your Windows Task Scheduler task.

    To create a sleep batch file open up Notepad and type the following:

    Rundll32.exe Powrprof.dll,SetSuspendState Sleep

    [​IMG]

    Click File –> Save As, Under Save as type, choose All files *.* and give your file a name like sleep.bat (or something else with a .bat extension.)

    Got it? If not, you can just download the sleep and wake batch files I already created by clicking here.

    How to Create a Batch (.bat) File to Wake Your Computer
    There isn’t a command line command to wake your computer. That’s because if you are in a position to be running commands, then your computer is, of course, already awake. But what we can do is create a batch file with something arbitrary in it and then tell Windows Task Scheduler that it can wake the computer to run it. So, go ahead and make a batch file that does something like “echo Hello!” and then save it as wake.bat.

    [​IMG]

    Again, you can also just download our sleep / wake batch files here.

    How to Schedule Your Computer to Sleep and Wake at a Certain Times
    Now that we have batch files to sleep and wake our computer, all we need to do is tell Windows when to run them.

    Run Task Scheduler. The fastest way to get to it is by clicking the Start button and typing Task Scheduler.

    [​IMG]

    Click Action and then Create Task; in the General tab, give it a name like “Sleep.”

    [​IMG]

    In the Triggers tab, click New. Set the task up to begin “On a schedule” and choose daily and plug-in the time when you want it to run. Click OK.

    [​IMG]

    Your trigger will be enabled.

    [​IMG]

    Next, click the Actions tab and click New. Set the action to “Start a program” and browse to your sleep.bat script. Click OK.

    [​IMG]

    Here’s your action:

    [​IMG]

    If you want to prevent the computer from sleeping if programs are running or someone is using the computer, then use the following settings in the Conditions tab:

    [​IMG]

    Click OK. You’re done with this part. If you want to test it out, you can add a new trigger that sets it in motion 1 minute from now.

    [​IMG]

    Next, let’s make a Wake task. Click Action and Create Task, and name it Wake in the general tab.

    [​IMG]

    Then, create a daily trigger with the time you want to wake your computer.

    [​IMG]

    Next, go to the Actions tab and make an action to run your wake.bat script.

    [​IMG]

    Now, go to the Conditions tab. Here, make sure that the “Wake the computer to run this task” option is checked.

    [​IMG]

    Click OK. Now, your computer will wake and sleep at the scheduled times.

    Source: https://www.groovypost.com/
     
    Last edited: Nov 29, 2019
    fantaskarsef and HK-1 like this.
  4. anticupidon

    anticupidon Ancient Guru

    Messages:
    7,878
    Likes Received:
    4,126
    GPU:
    Polaris/Vega/Navi
    Just ask NSA.
    Just kidding, wow, very nice tutorial. Gonna try that on a VM.
     
    Caesar likes this.

  5. HK-1

    HK-1 Master Guru

    Messages:
    962
    Likes Received:
    622
    GPU:
    RX580 Power Color
    very good job thanks for your contribution :)
     
    Caesar likes this.

Share This Page