How to create Windows sleep timer shutdown in Windows 11

To create a sleep timer shutdown in Windows 11, run shutdown /s /t 3600 from Command Prompt and the PC turns itself off in one hour.

This guide also covers the idle sleep timer in Settings, a true sleep countdown, nightly scheduled shutdowns, waking the PC at a set time, and fixes for a timer that does nothing.

How to create Windows Sleep Timer Shutdown in Windows 11
The Put the computer to sleep list sets the idle sleep timer for the active power plan; Never turns it off. (Image: Microsoft Q&A)

How to set up Windows sleep timer shutdown

The built-in shutdown command takes a countdown in seconds, so a timer needs no extra software.

Any countdown above zero forces open apps to close, so save your work before the timer runs out.

  1. Select Search on the taskbar, type cmd and open Command Prompt.
  2. Work out the delay in seconds: 30 minutes is 1800, 1 hour is 3600, 2 hours is 7200.
  3. Type shutdown /s /t 3600 and press Enter, replacing 3600 with your own number.
  4. Leave the PC running. It shuts down on its own when the countdown reaches zero.
  5. To stop the timer early, open a new Command Prompt window and run shutdown /a.

The valid range for /t is 0 to 315360000 seconds, which is ten years. Without /t, the default delay is 30 seconds.

You can also type the same command in the Run dialog box instead of opening Command Prompt.

Windows sleep timer or shutdown timer: which one to use

What you want Use this Why
Turn the PC off once, after a set number of minutes shutdown /s /t <seconds> Built in, one line, cancel with shutdown /a
Put the PC to sleep whenever it sits unused Make my device sleep after in Settings This is the permanent idle sleep timer
Put the PC to sleep once, after a countdown PsShutdown -d -t Windows' own shutdown command has no sleep switch
Hibernate instead of shutting down shutdown /h Keeps open apps; needs hibernation enabled
Shut down at the same clock time every night schtasks with a DAILY trigger Runs without you starting a countdown each time
Shut down after the PC has been idle schtasks with an ONIDLE trigger Fires only after 1 to 999 idle minutes
Wake the PC from sleep at a set time Scheduled task with WakeToRun Task Scheduler can wake the computer for a task

How to change the Windows 11 sleep timer in Settings

Windows 11 already has a sleep timer: the idle timeout that sends the PC to sleep after a period with no input.

Laptops show separate values for plugged in and on battery.

  1. Select Start > Settings > System > Power & battery.
  2. Expand Screen, sleep, & hibernate timeouts.
  3. Open the Make my device sleep after list and pick a time, such as 15 minutes.
  4. Set the battery value too if your laptop shows both plugged in and on battery options.
  5. Open Turn my screen off after if you want the display to go dark sooner than sleep.
  6. Close Settings. The new timer applies immediately.

On Windows 10 the same setting sits under Settings > System > Power & sleep. To set it from a command line, run powercfg /change standby-timeout-ac 30; the value is in minutes, and standby-timeout-dc sets the battery value.

Windows sleep timer command: sleep after a countdown

The Windows shutdown command can shut down, restart or hibernate, but it has no sleep switch.

PsShutdown, a free Sysinternals tool published by Microsoft, adds suspend with a countdown.

  1. Download PsTools from the PsShutdown page on Microsoft Learn (learn.microsoft.com/sysinternals).
  2. Extract the archive and copy psshutdown.exe to a folder on your path, or open Command Prompt in its folder.
  3. Type psshutdown -d -t 1800 and press Enter to suspend the PC in 30 minutes.
  4. Add -c if you want the signed-in user to be able to cancel the countdown.
  5. Run psshutdown -a while the countdown is still running to abort it.

The -t value is either a countdown in seconds or a clock time in 24-hour notation. The default countdown is 20 seconds.

To hibernate on a timer instead, use psshutdown -h -t 1800, or set the idle timer in Settings to send the PC to sleep and let Windows hibernate from there.

Windows sleep timer command tool PsShutdown page with the Download PsTools link
PsShutdown ships inside the PsTools archive, so extract psshutdown.exe before running psshutdown -d -t 1800. (Image: Microsoft)

Schedule a Windows 11 shutdown at a set time every night

A countdown is fine for tonight. For a fixed bedtime, create a scheduled task once and let Windows run it daily.

  1. Select Search, type cmd, then select Run as administrator.
  2. Type schtasks /create /tn "Nightly shutdown" /tr "shutdown /s /t 60" /sc daily /st 23:30 and press Enter.
  3. Change 23:30 to your own time. The /st value uses the 24-hour HH:mm format.
  4. For a single date instead of every night, replace /sc daily with /sc once and keep /st.
  5. To shut down after the PC sits unused, use /sc onidle /i 30 instead of /sc daily /st 23:30.
  6. To remove the schedule later, run schtasks /delete /tn "Nightly shutdown".

The 60-second countdown in the task gives you time to run shutdown /a if you are still using the PC.

The task follows the PC's clock, so set the correct time zone first if the time shown on the taskbar is wrong.

Prevent hard disk from going to sleep in Windows 11

Windows can power down an idle hard disk separately from the rest of the PC. An external drive that spins down mid-copy or a backup that stalls are the usual reasons to stop it.

The disk timeout is a minute value, and 0 means the disk is never powered down for idleness.

  1. Open Command Prompt as administrator.
  2. Type powercfg /change disk-timeout-ac 0 and press Enter to stop disk sleep while plugged in.
  3. On a laptop, also run powercfg /change disk-timeout-dc 0 for battery power.
  4. To restore a timeout later, run the same command with a number of minutes, such as powercfg /change disk-timeout-ac 20.

These commands change the active power plan only. If you switch plans, run them again.

Prevent hard disk sleep in Windows 11 power plan advanced settings
A value of 0 minutes means the disk is never powered down for idleness, the same as powercfg /change disk-timeout-ac 0. (Image: Microsoft Q&A)

How to wake up computer from sleep at a particular time in Windows 11

Task Scheduler can wake a sleeping computer when a task is due. A small task with the WakeToRun setting works as an alarm clock for the PC.

When Windows wakes for a task, the screen can stay off until it detects that someone is using the PC.

  1. Select Search, type powershell, then select Run as administrator.
  2. Run $a = New-ScheduledTaskAction -Execute "cmd.exe" -Argument "/c exit" to create a harmless action.
  3. Run $t = New-ScheduledTaskTrigger -Daily -At 6:30am, or use -Once -At 6:30am for a single morning.
  4. Run $s = New-ScheduledTaskSettingsSet -WakeToRun so the task wakes the computer.
  5. Run Register-ScheduledTask -TaskName "Morning wake" -Action $a -Trigger $t -Settings $s to save it.
  6. Open Control Panel > System and Security > Power Options, open the active plan's advanced settings, and confirm Sleep > Allow wake timers is enabled.
  7. Put the PC to sleep, not shut down, before the wake time.

A wake task works from sleep and hibernation. It cannot start a PC that is fully shut down; Wake on LAN from another device on the network is the usual way to do that on supported hardware.

Wake up computer from sleep at a particular time via Control Panel Power Options
From this page, open the active plan's advanced settings and confirm Sleep > Allow wake timers is enabled. (Image: Microsoft Q&A)

Check a Windows shutdown timer or wake timer is set

  1. After shutdown /s /t, run shutdown /a in a new window only if you want to test it: cancelling succeeds when a countdown is pending, then set the timer again.
  2. For a wake task, open an administrator Command Prompt and run powercfg /waketimers. Your task should be listed with its expiry time.
  3. After the PC wakes, run powercfg /lastwake to see what woke it.
  4. For the idle sleep timer, leave the PC untouched for the chosen time and confirm it sleeps.

Computer will not wake up from sleep mode in Windows 11

The PC stays asleep when you press a key or move the mouse

Only devices armed for wake can bring the PC out of sleep, and many keyboards and mice are not armed.

  1. Press the PC's power button briefly. On most PCs this resumes from sleep.
  2. Open Command Prompt as administrator and run powercfg /devicequery wake_armed to list devices that can wake the PC.
  3. Run powercfg /devicequery wake_programmable to list devices that could be armed.
  4. Run powercfg /deviceenableawake "<device name>" with your keyboard's name from that list.
  5. Put the PC to sleep and test the keyboard again.

The scheduled wake time passes and the PC stays asleep

Wake timers are disabled in the power plan, or the task lacks the WakeToRun setting.

  1. Run powercfg /waketimers as administrator and check that your task is listed.
  2. If it is missing, recreate the task with New-ScheduledTaskSettingsSet -WakeToRun.
  3. Confirm Sleep > Allow wake timers is enabled in the active plan's advanced settings.
  4. Make sure the PC was put to sleep, not shut down.

USB devices or the display misbehave after waking

Some connected devices do not resume cleanly from sleep or hibernation.

  1. Disconnect and reconnect the affected device.
  2. Restart the PC if the device still does not respond.
  3. Check the PC maker's support site for updated chipset and USB drivers.

Windows sleep timer not working: fixes

The PC never goes to sleep after the set time

An app or driver holds a power request that blocks sleep, such as a media player or a download.

  1. Open Command Prompt as administrator.
  2. Run powercfg /requests to list apps and drivers blocking sleep.
  3. Close or pause the app or driver the list names.
  4. Wait for the idle time again and confirm the PC sleeps.

The PC wakes up by itself soon after sleeping

A scheduled task or maintenance timer is allowed to wake the PC.

  1. Run powercfg /lastwake to see what woke the PC.
  2. Run powercfg /waketimers to list pending wake timers and the task behind each.
  3. Disable Allow wake timers in the plan's advanced settings if you do not need any wake task.
Windows sleep timer not working fix: open Power Options in Control Panel
Power Options leads to the plan's advanced settings, where Allow wake timers can be disabled if no wake task is needed. (Image: Microsoft Q&A)

Windows 11 sleep timer shutdown FAQ

Does Windows have a sleep timer?

Yes. Windows 11 puts the PC to sleep after the idle time set in Make my device sleep after under Settings > System > Power & battery. For a one-off shutdown countdown, use shutdown /s /t followed by the delay in seconds.

How do I set a sleep timer on my PC?

Open Settings > System > Power & battery, expand Screen, sleep, & hibernate timeouts and choose a time under Make my device sleep after. The PC then sleeps whenever it sits unused for that long.

How do I set a sleep timer in Windows 10?

Go to Settings > System > Power & sleep and pick a time under the Sleep setting. The shutdown /s /t and powercfg /change standby-timeout-ac commands work the same way on Windows 10 as on Windows 11.

What is the Windows sleep timer command?

Windows has no built-in command that sleeps after a countdown. powercfg /change standby-timeout-ac 30 sets the idle sleep timer to 30 minutes, and Microsoft's PsShutdown runs psshutdown -d -t 1800 to suspend the PC in 30 minutes.

How do I set a shutdown timer in Windows 11?

Open Command Prompt and run shutdown /s /t followed by seconds, for example shutdown /s /t 3600 for one hour. The PC shuts down when the countdown ends.

How do I cancel a shutdown timer?

Open a new Command Prompt window and run shutdown /a before the countdown ends. The command only works while a shutdown is still pending.

Will a shutdown timer close my open apps?

Yes. Any /t value above zero implies /f, which forces running apps to close without warning. Unsaved work in those apps is lost, so save everything before the timer expires.

What is the longest shutdown timer Windows allows?

The /t switch accepts 0 to 315360000 seconds, which equals ten years. For anything longer than a day, a scheduled task with schtasks is easier to manage.

Can Windows hibernate on a timer instead of shutting down?

Yes. shutdown /h hibernates the PC if hibernation is enabled, and psshutdown -h -t 1800 hibernates after a 30-minute countdown. Hibernate keeps your open apps and uses less power than sleep.

Where is the Sleep button in Windows 11?

Pressing the power button or closing a laptop lid puts the PC to sleep when those actions are set to Sleep. Change them in Control Panel > System and Security > Choose what the power buttons do.

Best way to create a sleep timer shutdown in Windows 11

Use shutdown /s /t <seconds> for a one-time shutdown timer and the Make my device sleep after setting for everyday sleep. Both are built into Windows 11, need no downloads, and can be undone in seconds with shutdown /a or a different timeout.

Philip Celasco

Philip is a Texas-based technology writer and IT administrator at Techdows.com with more than 10 years of experience creating practical content for everyday users and professionals. He specializes in web browsers, particularly Chromium-based platforms such as Google Chrome, Microsoft Edge, Brave, and Opera. Through his work as an IT administrator, Philip has hands-on experience managing devices, configuring browser policies, troubleshooting software and network issues, and helping people resolve problems that affect productivity and security. His articles are based on practical testing and real-world technical experience. He covers browser settings, extensions, performance problems, privacy controls, security features, and Windows troubleshooting. Outside work, Philip enjoys the quieter side of life in Texas and stepping away from the screen when he can. He has two kids, two cats and loves to play golf with his mother during the weekends.

Leave a Reply

Your email address will not be published. Required fields are marked *