How to Create a Shutdown Timer in Windows 10

Command Prompt, Task Scheduler, and other ways to automate shutdowns one time or on a regular schedule

What to Know

  • For one-time use: Open Command Prompt and enter shutdown -s -t 30 (or any number of seconds).
  • That same command also works through the Run dialog box.
  • You can use Task Scheduler to set up a detailed system for regularly scheduled shutdown events.

This article explains four ways to set a specific, automatic shutdown time for your PC. We also include information on how to stop a scheduled shutdown.

How to Schedule a Computer to Shut Down With Command Prompt

Follow these steps to use Command Prompt for a one-time shutdown.

  1. In the Windows search box, type CMD and then press Enter to open Command Prompt.

  2. In the Command Prompt window, type shutdown -s -t and the number of seconds you want. Here's an example:

    shutdown -s -t 1200
    
    The Command Prompt window showing the shutdown command for 20 minutes.

    The CMD and Run command processes use seconds to measure time, not minutes. For example, if you want to shut down in 10 minutes, use 600 seconds. If you want your computer to shut off in 10 hours, use 36,000. The choice is always yours; remember to add it in seconds instead of minutes.

  3. Press Enter to run the command.

  4. A window will pop up, warning you Windows will shut down in the amount of time you requested.

    The Windows logon reminder showing the amount of time remaining before automatic logoff.

That's it. Your computer will now automatically shut down at the time you specified. You'll receive a warning a few minutes before shutdown to remind you then, too.

The Windows shutdown warning a few minutes before the computer shuts down.

How to Cancel an Automatic Shutdown in Windows 10

No longer want your computer to shut down at a specific time? To cancel an automatic shutdown triggered by a command, open Command Prompt and enter this:

shutdown -a

A message that says Logoff is cancelled confirms the command worked.

How to Set up Automatic Shutdown With the RUN Command

The same shutdown command discussed above can be triggered from the Run dialog box. Here's how to do that:

  1. In the Windows search box, type RUN and then press Enter.

    You can instead press Win + R.

  2. In the Run dialog box, type shutdown -s -t and the number of seconds you need.

    The Run dialog box with the shutdown command for 20 minutes.
  3. Select OK.

  4. A window will pop up showing you that it received your request, and your computer will log off at the time you requested.

Using PowerShell for Immediate Shutdown

PowerShell is yet another way to shut down Windows 10 with a command. It works a lot like Command Prompt but with a slightly different command. Here's how to turn off your computer instantly through PowerShell:

  1. Open PowerShell with the Power User Menu or by searching for Windows PowerShell from the search box.

  2. Type the following command at the prompt:

    Stop-Computer -ComputerName localhost
    
    The stop-computer shutdown command in Windows 10 PowerShell
  3. Press Enter.

    Make sure you've saved or closed any documents or apps as this will shut down your computer immediately.

How to Use Task Scheduler to Set up Regular Shutdowns

If you need to set a shutdown timer for multiple uses (i.e., daily or weekly automatic shutdowns), it's best to use the Task Scheduler, so you don't have to remember to set things up all the time. Follow these steps:

  1. Open the Task Scheduler by typing Schedule into the Windows search box.

  2. Select Enter.

    The Task Scheduler option in the Windows search box.
  3. Go to Action > Create Basic Task.

    The Action menu open in Task Scheduler
  4. In the Name and Description boxes, enter a name and description of your task. Select Next.

    Naming and describing a task in Task Scheduler.
  5. Pick when you want the task to run, such as Daily or Monthly, and then select Next.

    A list of Task Scheduler triggers in Windows 10
  6. Enter the dates and times as needed using the prompts from the wizard. Select Next.

    The Task Scheduler window showing date and time prompts.
  7. Choose Start a program from the list and then select Next.

    Task Scheduler Action Windows with Start a Program highlighted
  8. Select Browse, choose shutdown.exe from the System32 folder, then select Open.

    Two windows showing the Browse button to help select the Shutdown program.
  9. Select Next.

  10. In the Summary window, select Finish.

    The Summary window showing the Finish button.

With these four approaches, you can manage your computer's time and energy with ease.

FAQ
  • How can I set a sleep timer on my Windows 10 PC?

    To set your Windows 10 sleep timer, you'll change your Windows sleep settings. In the Search box, search for sleep, and select Power & sleep settings from the results. In the Sleep section, under When plugged in, PC goes to sleep after, select the drop-down box to choose the amount of time you want your computer to remain idle before going to sleep.

  • How do I set a shutdown timer in Windows 8?

    To set a shutdown timer in Windows 8, press Windows+X to bring up the Quick Access Menu. Select Run, enter a shutdown command in the box > OK. Or, open Task Scheduler and choose Create Basic Task, enter shutdown > Next. Then, select the start date, shutdown time, and frequency and follow the prompts.

Was this page helpful?