windows 10 pc back to sleep in two minutes after waking up with task scheduler

1.2k Views Asked by At

Created a task scheduler item using cmd.exe/c "exit". This wakes a Windows 10 PC up each day at 6AM. The monitors stay dark as intended. The Windows Form app that I had started before putting it to sleep the evening before continues.

Here is the problem: some mornings the PC wakes up on time but goes back to sleep after a bit more than two minutes. Changing the app to write to the output window in Visual Studio 2019 or 2022 every minute does not help.

Unless I am awake and jiggle the mouse to bring the monitors alive then the PC stays awake. But this negates the benefit. If i am up there is no need to automatically wake the PC up.

The power settings are in never go to sleep mode. Enable wake timers is on. I experimented with one-time scheduled tasks to wake the PC up during the day, the result is the same. Goes back to sleep after two minutes unless I jiggle the mouse to activate the monitors. Then it stays awake.

1

There are 1 best solutions below

1
HBC531 On

Windows 10 has a parameter called "system unattended sleep timeout". This is not typically visible in sleep in settings. This article shows how to make it visible: https://winaero.com/add-system-unattended-sleep-timeout-to-power-options-in-windows-10/#:~:text=%20To%20System%20Unattended%20Sleep%20Timeout%20to%20Power,use%20the%20following%20command%3A%20powercfg%20-attributes...%20More%20 One can then set this timeout to any desired value. As the PC wakes up from sleep using Task Scheduler and without a user turning the monitors on by jiggling the mouse the PC is considered unattended. It is a safety feature. I checked it out and it works. So, thanks SO for helping me resolve this issue.

To clarify, I used this page: https://thegeekpage.com/how-to-schedule-your-windows-11-pc-to-wake-up-automatically/ to setup a task that wakes up the PC at a given time. The problem was the PC went back to sleep after two minutes. The parameter that defined this time is typically invisible. The article in the first reference describes how this parameter can be made visible.

I set it to 180 minutes. Now the PC wakes up and stays awake for 180 minutes even if I leave it unattended by not turning the screens on.

My app is an options trade signaling and trading app. I am in the Pacific Time zone. This feature allows the app to start the evening before, set the PC to sleep and then wake up before market open to continue running the app whether I am there or not.