Why not just "move the mouse every 10 seconds"?
Two problems with the blind-jiggle approach — keepawake fixes both.
It fights your hand
A timed jiggle twitches the cursor mid-click and mid-drag. keepawake nudges only after you've gone idle, so it never interferes while you work.
It only does half the job
Moving the mouse keeps the display on, but the real goal is also not locking. keepawake handles display power and the idle-lock timer.
No install, no bloat
One PowerShell script and a double-click launcher. PowerShell already ships with Windows — there's nothing to install and nothing running in your tray.
How it works
keepawake combines the two OS-supported mechanisms that actually match the goal.
| Mechanism | What it does | Covers |
|---|---|---|
SetThreadExecutionState |
Asks Windows to keep the display & system powered on for as long as it runs. No fake input. | Display sleep / power-off |
| An inert nudge (invisible F15 keypress, or a net-zero 1px mouse jiggle) |
Sent only after you've gone idle. Resets the OS input-idle timer that drives the screensaver / inactivity lock. | Auto-lock / screensaver |
The key detail: SetThreadExecutionState keeps the screen on but does not stop an idle auto-lock — that's driven by the input-idle timer. The nudge fills exactly that gap, and because it fires only when you're already idle, it stays completely out of your way.
Quick start
- Download & unzip — grab keepawake.zip and extract it anywhere.
- Double-click
keepawake.cmd— a console window opens and it starts keeping your screen alive. - Stop any time — press Ctrl+C or close the window. It releases the keep-awake request cleanly.
Prefer a terminal, or want to check it first? Run the built-in self-test:
powershell -NoProfile -ExecutionPolicy Bypass -File keepawake.ps1 -SelfTest
Tune it with options — for example, only nudge after 60s idle using a mouse jiggle instead of a keypress:
powershell -NoProfile -ExecutionPolicy Bypass -File keepawake.ps1 -IdleSeconds 60 -Method Mouse
Options
| Option | Default | Meaning |
|---|---|---|
-IdleSeconds <n> | 30 | Only nudge after n seconds of no real input. Keep it below your lock timeout. |
-Method Key|Mouse | Key | Key = invisible F15 keypress. Mouse = move cursor +1px then −1px (net zero). |
-SelfTest | — | Run once, fire a single nudge, and exit — to confirm it works on your machine. |
Is it safe?
Open & readable
It's a plain-text PowerShell script — open it in Notepad and read every line before you run it. No compiled binary, no telemetry, no network calls.
Uses documented Windows APIs
Only standard Win32 calls (SetThreadExecutionState, SendInput, GetLastInputInfo) — the same ones Microsoft's own PowerToys Awake uses.
Leaves no trace
Nothing is installed. Stop it and Windows power management returns to exactly how it was — the keep-awake request is released on exit.
Just want the screen to stay on and don't care about locking? Microsoft's official PowerToys → Awake is a no-code toggle. But like keepawake's display mechanism alone, it won't stop an inactivity auto-lock — that's the gap keepawake's idle nudge is built to fill.