Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

How to Set a PC Sleep Timer on Windows 10 or 11

· 6 min read · Home Tech

In this article
  1. Before You Start: Check What You're Working With
  2. Set the Sleep Timer in Settings
  3. Set a Countdown Timer with a Command
  4. Check That the Timer Actually Works
  5. Symptom / Cause / Fix Table
  6. Set a Timer for a Specific Time of Day
  7. Why the Sleep Timer Might Not Work (and What to Do)

The most common way a sleep timer fails is that the PC wakes up again or never sleeps because a setting elsewhere overrides it. The reliable method is to use Windows' built-in power settings, not a third-party app. Here is how to set a sleep timer that actually holds.

Before You Start: Check What You're Working With

You need to know two things before you begin: which version of Windows you have, and whether you want the timer to apply when the PC is plugged in, on battery, or both. The steps below work for Windows 10 and Windows 11, but menu labels can differ slightly by version.

  • Find your Windows version: Press Windows key + R, type winver, and press Enter. A small window shows the version and build number.
  • Decide the scope: On a laptop, you can set different sleep times for battery and plugged-in. On a desktop, only the plugged-in setting matters.
  • Know your current power plan: Open Settings > System > Power & sleep (Windows 10) or Settings > System > Power & battery (Windows 11). The plan shown there is the one you will edit.

Set the Sleep Timer in Settings

This is the fastest method for most people. It sets the PC to sleep after a fixed period of inactivity.

  1. Open Settings (press Windows key + I).
  2. Go to System > Power & sleep (Windows 10) or System > Power & battery (Windows 11).
  3. Under Sleep, you will see two dropdown menus: On battery power, sleep after and When plugged in, sleep after. Choose a time from the list, such as 30 minutes or 1 hour. If you never want it to sleep, choose Never.
  4. Close Settings. The change takes effect immediately.

That is the whole method. The PC will sleep after the selected time of no keyboard, mouse, or touch input. If you want a timer that counts down from a set time regardless of activity, use the command-line method below.

Set a Countdown Timer with a Command

Sometimes you want the PC to sleep after a specific delay, like 45 minutes, no matter what you are doing. Windows has a built-in command for that. It uses the shutdown command with the /s flag and a time in seconds.

  1. Press Windows key + R to open the Run dialog.
  2. Type cmd and press Ctrl + Shift + Enter to open Command Prompt as administrator. (If prompted by User Account Control, click Yes.)
  3. Type the following command and press Enter:
    shutdown /s /t 2700
    This tells Windows to shut down after 2700 seconds (45 minutes). Replace 2700 with any number of seconds you want.
  4. You will see a notification saying the PC will shut down in a certain amount of time. To cancel it, open Run again and type shutdown /a, then press Enter.

Note: this command shuts down, not sleeps. If you want sleep instead, use shutdown /h (hibernate) or use the powercfg command with a timer. The simplest way to get a true sleep timer is to combine the command with a scheduled task, but that is more complex. For most people, the Settings method is enough.

Check That the Timer Actually Works

After you set a sleep timer, you want to confirm it will fire. Here is a quick test.

  1. Set the sleep timer to 1 minute in Settings.
  2. Stop touching the mouse and keyboard. Do not close the lid or press any keys.
  3. After about 1 minute, the screen should go off and the PC should enter sleep (the power light may blink or turn off).
  4. Press a key or move the mouse to wake it. Then set the timer back to your preferred time.

If the PC does not sleep, something is keeping it awake. The table below lists the usual culprits.

Symptom / Cause / Fix Table

SymptomCauseFix
PC sleeps but wakes up by itselfWake timers are enabled, or a device like the mouse or network card is allowed to wake the PCOpen Device Manager, right-click your mouse and network adapter, go to Power Management, and uncheck Allow this device to wake the computer. Also go to Settings > System > Power & sleep > Additional power settings > Change plan settings > Change advanced power settings > Sleep > Allow wake timers and set it to Disable.
PC never sleeps even after the set timeAn app or process is keeping the system activeOpen Command Prompt as administrator and type powercfg /requests. This shows what is preventing sleep. Close that app or end the process.
Sleep option is greyed outA power plan or group policy is blocking sleepGo to Control Panel > Power Options, click Change plan settings next to your plan, then Change advanced power settings. Under Sleep, make sure Sleep after is set to a number, not Never. If it is greyed out, run powercfg -restoredefaultschemes in an admin command prompt.

Set a Timer for a Specific Time of Day

If you want the PC to sleep at, say, 11:00 PM every night, you can use Task Scheduler. This is more advanced but gives you a daily routine.

  1. Press Windows key, type Task Scheduler, and open it.
  2. Click Create Basic Task on the right.
  3. Name it Sleep Timer and click Next.
  4. Choose Daily and click Next. Set the start time to your desired sleep time, such as 11:00 PM.
  5. Choose Start a program and click Next.
  6. In the Program/script box, type shutdown. In the Add arguments box, type /s /t 0 (or /h for hibernate). Click Next, then Finish.
  7. To test it, right-click the task and select Run. The PC will shut down immediately, so only do this when you are ready.

For a sleep timer that only runs once, you can use the command-line method from earlier instead of a scheduled task.

Why the Sleep Timer Might Not Work (and What to Do)

If you followed the steps and the PC still does not sleep, check the following in order:

  • Media playback: If you are playing music or a video, Windows may keep the system awake. Pause or stop playback.
  • Downloads or updates: Active downloads or Windows Update can prevent sleep. Let them finish or pause them.
  • External devices: A USB device like a game controller or a phone charging may keep the PC awake. Unplug them and test.
  • Power plan settings: Some power plans have a separate Sleep after setting under Advanced power settings. Check that it matches your chosen time.

If the PC still refuses to sleep after all this, run the powercfg /energy command in an admin command prompt. It generates a report in the current folder (usually C:\Windows\system32\energy-report.html) that lists errors and warnings. Open that file in a browser and look for items under Errors.

Setting a sleep timer is a small change that saves power and keeps your PC quiet at night. Once you set it, you can forget about it. If you ever need to change it, just revisit the same settings.