Skip to content

Keepawake Two Windows traps

Ilia edited this page Nov 9, 2026 · 1 revision

Both cost debugging and both are pinned down in the code.

schtasks refuses with "Access is denied" on any logon trigger: ONLOGON counts as privileged, while PowerShell started from WSL is unprivileged. So systemd inside WSL brings the Windows side up (keepawake-windows) — and shuts it down when the distribution stops: while WSL is not running there is nobody to hold for, and there must be no deviation from Windows' own rules.

PowerShell 5.1 reads UTF-8 without a BOM as ANSI. Any non-ASCII byte then decodes to something else, string lengths drift apart, the parser loses block boundaries, and the script dies on Missing closing '}' at a spot where everything is written correctly. install.sh copies the file with a BOM — do not change that to a plain cp.


Generated from docs/keepawake.md; edit it there, then rebuild with wiki/build.py.

Clone this wiki locally