PowerToys Awake: Keep a Windows PC Awake for Long-Running Jobs

What each mode does, how to tie it to a build or agent run from the command line, and the sleep it won't prevent.

Updated November 16, 2026

PowerToys Awake is the keep-awake utility in Microsoft PowerToys, the free set of Windows add-ons. It holds a Windows PC awake without touching your power plan: while it runs, it asks Windows to keep the machine (and, if you want, the display) on, and when it exits, your normal sleep settings apply again.

That makes it a good fit for an overnight build, a large download or an AI agent working through a long task. This guide covers what each setting does, how to run Awake from a script so the request lasts exactly as long as the job, and the cases where the machine will sleep anyway.

How Awake keeps Windows awake

Awake doesn't edit any power plan setting and doesn't need a custom plan. According to Microsoft's documentation, it starts background threads that tell Windows they need the machine in a particular state. When Awake exits, those threads end and the computer goes back to its standard power plan behavior.

Two conditions apply: Awake only works while you're signed in, and only while it's enabled. It's meant for a machine you're using or one in a private place. For a PC that has to stay up while nobody is signed in, change the power plan itself (see the comparison below).

The four modes

Turn on Enable Awake in PowerToys Settings, then pick a mode. The same choices are on the Awake icon in the system tray (right-click it), and the icon changes to show which one is active.

ModeWhat it doesUse it for
Keep using the selected power plan (passive)Awake runs but requests nothing. Your power plan decides when the PC sleeps.Leaving Awake installed without it doing anything.
Keep awake indefinitelyThe PC stays awake until you put it to sleep yourself or turn Awake off.A job with no predictable end, if you'll remember to switch it off.
Keep awake for a time intervalStays awake for the hours and minutes you set, then returns to passive.A job you can time: a download, a test suite, a render.
Keep awake until expirationStays awake until a date and time you set.Holding the machine up until a fixed point, such as the morning.

Changing the hours or minutes while a time interval is running resets the timer.

Keep screen on, and what locking the PC does

By default Awake keeps the computer awake but lets the displays turn off on their usual schedule. The Keep screen on switch keeps them lit too. It only works with one of the keep-awake modes selected, not in passive mode.

Locking the PC changes one thing. Awake stops holding the display on, so Windows can turn the screen off according to your power plan, but the keep-awake mode stays active and the computer itself stays awake. When you unlock, the screen is held on again. So for unattended work you can lock the PC and walk away: the job keeps running, and the screen goes dark.

Running Awake from the command line

Awake also runs on its own as PowerToys.Awake.exe, which sits in the PowerToys install folder. You still need PowerToys installed to have it; the standalone part is that it can run without PowerToys Settings. With no arguments it keeps the computer awake indefinitely. These are the arguments Microsoft documents:

ArgumentWhat it does
--time-limitStay awake for this many seconds, then exit.
--expire-atStay awake until this time, or date and time, by the computer's clock.
--display-ontrue or false: whether to keep the displays on too. Combines with --time-limit and --expire-at.
--pidAttach to a process ID. When that process ends, Awake ends too.
--use-parent-pidAttach to the process that started Awake, and end when it ends.
--use-pt-configRead the mode and settings from PowerToys' own settings.json and follow changes to it. All other arguments are ignored.
# Ten hours, display allowed to turn off
PowerToys.Awake.exe --time-limit 36000 --display-on false

# Until 5 PM today
PowerToys.Awake.exe --expire-at=17:00:00

# Until a date and time
PowerToys.Awake.exe --expire-at="4/13/2027 07:00:00"

Both --time-limit 36000 and --time-limit=36000 are accepted.

Tie Awake to a build or agent run with --pid

A timer is a guess. If the job finishes early the PC stays up for nothing, and if it runs long the PC can sleep mid-job. --pid removes the guess: Awake holds the machine up exactly as long as the process you point it at is alive. In PowerShell, start the job, take its process ID and hand it to Awake:

# Start the long-running job and keep a handle on it
$job = Start-Process -FilePath "python" -ArgumentList "train.py" -PassThru

# Find PowerToys.Awake.exe in the usual per-user and machine-wide folders
$awake = "$env:LOCALAPPDATA\PowerToys", "$env:LOCALAPPDATA\Programs\PowerToys", "$env:ProgramFiles\PowerToys" |
  ForEach-Object { Join-Path $_ "PowerToys.Awake.exe" } |
  Where-Object { Test-Path $_ } | Select-Object -First 1

# Keep the PC awake until that process exits; let the screen sleep
Start-Process -FilePath $awake -ArgumentList "--pid $($job.Id) --display-on false"

Where PowerToys lives depends on the installer: a per-user install goes under your local AppData folder, a machine-wide one under %ProgramFiles%\PowerToys. The script checks those folders; if $awake comes back empty, look in the folder you installed PowerToys to. Point --pid at the process that actually runs the work, not a launcher that exits straight away, or Awake will end with the launcher.

If the job is started by a script, --use-parent-pid does the same from the other side: launch Awake from inside that script and it ends when the script does.

Custom durations in the tray menu

The tray menu's Keep awake temporarily list comes from Awake's settings.json, in %HomePath%\AppData\Local\Microsoft\PowerToys\Awake\. Add your own entries to customTrayTimes as a name and a duration in seconds:

{
  "properties": {
    "keepDisplayOn": false,
    "mode": 2,
    "intervalHours": 2,
    "intervalMinutes": 0,
    "customTrayTimes": {
      "8 hours": 28800,
      "12 hours": 43200
    }
  },
  "name": "Awake",
  "version": "1.0"
}

mode is 0 for passive, 1 for indefinite, 2 for a time interval and 3 for a set expiry.

What Awake won't stop

  • Sleep you ask for. Awake doesn't block user-initiated sleep or hibernation. Choosing Sleep from the Start menu, pressing the power button or closing a laptop's lid still does whatever your power settings say. Microsoft's own docs for SetThreadExecutionState, the Windows call for this kind of request, say it can't stop the user putting the computer to sleep. To keep a laptop running with the lid shut, set the lid action to Do nothing in the power settings.
  • Being signed out. Awake only works while you're signed in. A machine that reboots overnight for updates and sits at the sign-in screen isn't covered.
  • The display while the PC is locked. Keep screen on only applies while the PC is unlocked.
  • Modern Standby edge cases. On PCs that use Modern Standby, a keep-awake request on its own hasn't always been enough. Our piece on Windows power requests covers a reported case where a long task was aborted anyway, and why a power request scoped to the job is more dependable.
  • Dropped connections. A PC that stays awake can still lose an idle SSH or API connection to a network timeout. That's a keepalive problem, covered in TCP keepalive tuning for overnight agent connections.

Awake compared with other ways to keep Windows awake

MethodHow long it lastsBest for
Awake, from Settings or the trayUntil you change it, a timer runs out or an expiry time passesInteractive use: a presentation, a download, a job you're watching
Awake with --pidExactly as long as one processScripted builds, training runs and agent sessions
Power plan timeouts (Settings, or powercfg /change standby-timeout-ac 0)Permanently, until you change it backA dedicated machine that should never idle-sleep, including when nobody is signed in
A power request made by your own programAs long as your code holds itTools you write yourself; see Windows power requests for long-running dev processes

To see what is holding a PC awake at any moment, run powercfg /requests in an elevated terminal. It lists the processes and drivers with an active power request, grouped by type.

On a Mac, the closest equivalent to Awake is the free Amphetamine app.

Installing PowerToys

Awake ships with PowerToys, which needs Windows 11, or Windows 10 version 2004 (build 19041) or newer, on an x64 or ARM64 processor. Microsoft recommends installing from the PowerToys releases on GitHub or the Microsoft Store. With WinGet:

winget install --id Microsoft.PowerToys --source winget

Then open PowerToys Settings, go to Awake and turn on Enable Awake. Features and menus change between releases, so check Microsoft's Awake documentation against the version you have installed.

Questions people ask

Does PowerToys Awake change my power plan?

No. It asks Windows to keep the machine awake while it runs and leaves the power plan as it is. When Awake exits, your normal sleep settings apply again.

Does Awake keep the PC awake when it's locked?

Yes. The keep-awake mode stays active while the PC is locked. Only Keep screen on stops, so the display can turn off according to your power plan.

Can Awake keep a laptop awake with the lid closed?

Not by itself. Closing the lid runs the lid action in your power settings. Set it to Do nothing if the laptop has to keep working with the lid shut.

Can I use Awake without the rest of PowerToys?

You can run PowerToys.Awake.exe on its own from the command line, but Microsoft documents and ships it as part of PowerToys: you get the executable by installing PowerToys.

Sources

  1. PowerToys Awake - Microsoft Learn

    Modes, Keep screen on, lock-screen behavior, command-line arguments and settings.json.

  2. Install PowerToys - Microsoft Learn

    System requirements, install methods and install locations.

  3. SetThreadExecutionState function - Microsoft Learn

    Why a keep-awake request can't stop sleep the user asks for, such as closing the lid.

  4. Microsoft PowerToys on GitHub

    Source code, releases and issue tracker.