Why does Windows go to sleep?
Windows measures the time since your last mouse or keyboard input. After a delay set in the power plan, it turns off the display, then puts the computer to sleep. On many PCs, the session also locks when the screen turns off or when the screen saver starts.
That saves energy, but it is annoying when you are reading, presenting, following a long download or watching a dashboard without touching anything.
Method 1: change the power settings
If you have the rights to change them, this is the simplest solution.
- Open Settings → System → Power & battery (called Power on desktop PCs).
- Expand Screen and sleep (on recent versions: Screen, sleep & hibernate timeouts).
- Choose Never, or a longer delay, for “Turn off my screen” and “Put my device to sleep”, on battery and when plugged in.
Limits: the change is permanent until you undo it, it can be blocked on work PCs, and it does not stop apps from showing you as “away”.
Method 2: the powercfg command
The same settings can be changed from a terminal, which is handy in a script. A value of 0 means “never”:
powercfg /change monitor-timeout-ac 0
powercfg /change standby-timeout-ac 0
Replace -ac with -dc for battery mode. To see which programs are currently keeping the PC awake, run powercfg /requests.
Method 3: PowerToys Awake
Microsoft’s free PowerToys suite includes Awake, which keeps the PC awake indefinitely, for a set time or until a given time, with an option to keep the screen on. It uses the Windows power API: no input is simulated.
Limits: you need to install the PowerToys suite, and because the idle timer is not reset, the automatic lock and the “away” status of chat apps can still occur.
Method 4: a mouse jiggler
A mouse jiggler simulates mouse activity at regular intervals. For Windows, it is as if you had moved the mouse: the idle timer is reset, so the screen stays on, the PC does not sleep and the inactivity lock does not trigger.
Mouse Jiggler is a free option for Windows 10 and 11:
- Classic mode moves the cursor a few pixels and back; Zen mode simulates activity without moving the cursor.
- Interval from 5 seconds to 1 hour, automatic stop after a duration or at a set time.
- No administrator rights needed, so it works on PCs where the power settings are locked.
- A scheduled lock can secure the session at the end of the day.
Limits: it cannot bypass a company policy that forces a lock after a fixed time regardless of activity, and it should be used in line with your organisation’s rules.
Which method should you choose?
| Need | Best method |
|---|---|
| Never sleep on your own PC | Power settings or powercfg |
| Stay awake for a few hours, then return to normal | PowerToys Awake or Mouse Jiggler with automatic stop |
| Prevent the inactivity lock and the “away” status | A mouse jiggler |
| No administrator rights | A mouse jiggler that installs per user |
Good practice
A PC that stays unlocked is a PC anyone can use. When you leave your desk, lock it with Win+L. With Mouse Jiggler, the scheduled lock can do it for you at a fixed time.