How to Automatically Shut Down Your Computer at a Specified Time

Download ArticleDownload Article

Do you want to schedule an automatic shutdown for your PC or Mac? It's easy to make any desktop or laptop computer turn off or restart at a particular time, either just once or on a regular schedule. This How.com.vn tutorial will show you different ways to set a timer that safely shuts down your computer on Windows and macOS.

Method 1
Method 1 of 4:

Scheduling Regular Shutdowns for Windows

Download Article
  1. How.com.vn English: Step 1 Open the Task...
    Open the Task Scheduler app. If you want your scheduled shutdown to occur more than once, you'll want to use Task Scheduler. Task Scheduler is available on all versions of Windows. Here's how to find it:[1]
    • Windows 11 & Windows 10: Press Win+S to open the search bar, type task scheduler, and then click Task Scheduler in the search results.
    • Windows 8: Press the Win key, type schedule tasks, and then click Schedule tasks in the results.
    • Windows 7: Click the Start menu, select Control Panel, and then choose System and Security. Click Administrative Tools and then click Task Scheduler.
  2. Step 2 Click Create Basic Task in the "Actions" panel.
    It's at the top of the panel on the right side of the window. This opens the "Create a Basic Task" wizard.[2]
    Advertisement
  3. How.com.vn English: Step 3 Type Shutdown timer for the name and click Next.
    You can also type in a different name if you want.
  4. How.com.vn English: Step 4 Select when you want the task to activate and click Next.
    For example, if you want the computer to turn off every night at 11:30 PM, select Daily. If this is just a one-time scheduled thing, select One time.[3]
  5. How.com.vn English: Step 5 Enter the time and date and click Next.
    For example, let's say that beginning on July 19, 2019, you want your PC to shut down nightly at 11:30 PM. You'd enter 7/19/2019 into the date field, and 11:30:00 PM into the time field.
    • Leave the "Recur ever: X days" setting to "1" if you want the action to occur every day.
  6. Step 6 Select "Start a program" and click Next.
    [4]
  7. Step 7 Type the path to the shutdown.exe app into the "Program/script" box.
    The location should be C:\Windows\System32\shutdown.exe unless you've changed the letter for your Windows drive.[5]
  8. Step 8 Type /s into the "Add arguments" field and click Next.
    [6]
  9. How.com.vn English: Step 9 Review your shutdown task and click Finish.
    The summary screen gives you a chance to review the scheduled date(s) and time(s) for the shutdown. Once you save your task, the computer will shut down at the scheduled time.[7]
    • If you need to edit or delete your task, open Task Scheduler and click the Task Scheduler Library folder in the left panel. When you find your task in the center panel, right-click it to find the option to edit Properties or Delete the task.
  10. Advertisement
Method 2
Method 2 of 4:

Scheduling Regular Shutdowns for macOS

Download Article
  1. How.com.vn English: Step 1 Click the Apple icon menu.
    It's at the top-left corner of the screen. A menu will expand.
  2. How.com.vn English: Step 2 Click System Preferences on the menu.
  3. How.com.vn English: Step 3 Click the Energy Saver icon.
    It looks like a lightbulb.
  4. How.com.vn English: Step 4 Click Schedule at the bottom-right corner of the window.
  5. How.com.vn English: Step 5 Check the box next to the second drop-down menu.
    It's the one that says either Sleep, Shut Down, or Restart.
  6. How.com.vn English: Step 6 Select Shut Down from the second menu.
  7. How.com.vn English: Step 7 Enter the time and frequency.
    For example, if you want the computer to shut down nightly at 11:30 PM, you'd choose Every Day from the bottom-center drop-down menu, and then enter 11:30 into the "at" box.
  8. How.com.vn English: Step 8 Click OK.
    As long as your Mac is awake at the scheduled time, it will shut down automatically.
  9. Advertisement
Method 3
Method 3 of 4:

Scheduling a One-Time Shutdown for Windows

Download Article
  1. How.com.vn English: Step 1 Right-click the Start...
    Right-click the Start menu
    How.com.vn English: Windows Start
    .
    It's usually at the bottom-left corner of the screen for most versions of Windows. For Windows 11, it's in the middle.
  2. How.com.vn English: Step 2 Click Command prompt (Admin) or Windows PowerShell (Admin).
    One or both options will appear in the menu.
    • If prompted to give permission for the app to run, follow the on-screen instructions to do so.
  3. How.com.vn English: Step 3 Type SHUTDOWN /S /F /T number-in-seconds.
    Replace number-in-seconds with how long from now (in seconds) you want the computer to shut down.[8]
    • For example, if you want the computer to turn off in 30 minutes, you'd type SHUTDOWN /S /T 1800.[9]
    • Check out this Google tool that can help you convert minutes and/or hours to seconds.
  4. How.com.vn English: Step 4 Press ↵ Enter.
    This runs the command and begins the timer. The PC will automatically shut down once the timer reaches the end.
    • If you want to cancel the automatic shutdown, return to the prompt and use the command shutdown /a.
  5. Advertisement
Method 4
Method 4 of 4:

Creating a Shutdown Shortcut for Windows

Download Article
  1. How.com.vn English: Step 1 Open Notepad...
    Open Notepad on your Windows PC. You write a script that adds a shortcut to your desktop that, when double-clicked, schedules a shutdown. You'll find Notepad in your Windows Start menu in a folder called Windows Accessories or Accessories.
    • Use this method if you don't want to schedule a recurring shutdown (e.g., nightly at 11:30pm) but would like to quickly schedule such a shut down if necessary.
  2. How.com.vn English: Step 2 Enter the following...
    Enter the following code into the Notepad file. Let's say you want the script to shut your computer down at 11:30 PM on the day you run it: Type each of the following lines on its own individual line in the file:
    • @echo off
    • :W
    • if %time%==23:30:00.00 goto :X
    • goto :W
    • :X
    • shutdown.exe /s /f /t 60 /c
      • This script will constantly check the time and, when 11:30 PM rolls around, will shut down the computer (after a 60-second grace period). You can replace that time with the time of your choice (in 24-hour/military time format).[10]
  3. How.com.vn English: Step 3 Click the File menu and select Save As.
    The Save As window will appear.
  4. How.com.vn English: Step 4 Open the Desktop folder.
    You can do this by expanding the This PC menu in the left panel and selecting Desktop.
  5. Step 5 Select All Files from the "Save as type" drop-down.
    It's near the bottom of the Save As window.[11]
  6. Step 6 Type shutdown-timer.bat into the "File name" field and click Save.
    Your new script is now saved to your desktop. You should see its icon (some gears) on your desktop.
  7. How.com.vn English: Step 7 Double-click the shutdown-timer.bat file to schedule a shutdown.
    A blank command prompt screen should appear. You will need to leave this window open so that the computer will know to shut down at the right time. Once the time comes, you'll have 60 seconds to save your work before the computer shuts down.
    • If you want to disable the script before it's time to shut down, press Win+R to open the Run menu, type shutdown –a, and then click Run.
  8. Advertisement

Community Q&A

Search
Add New Question
  • Question
    Does this work even if a game or program is running?
    How.com.vn English: Community Answer
    Community Answer
    Yes. Anything that is running will most likely turn off without a problem.
  • Question
    Does this work in 64-bit Win7?
    How.com.vn English: Community Answer
    Community Answer
    The option is available in Windows 7 and 8. It doesn't matter whether it is a 32-bit or 64-bit system.
  • Question
    I don't understand Step 4. What is the shutdown.exe file?
    How.com.vn English: Tim Newman
    Tim Newman
    Community Answer
    The shutdown.exe file is located in C:/Windows/System32/shutdown.exe. Opening this file will shut your computer down.
See more answers
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
      Advertisement

      Tips

      On Mac notebooks with macOS Big Sur (11.0) or later, open System Preferences > Battery > Schedule, and then follow steps 5 to 8 in the "Scheduling Regular Shutdowns for macOS" section

      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Thanks for submitting a tip for review!
      Advertisement

      Video

      Warnings

      Advertisement

      About This Article

      How.com.vn English: Nicole Levine, MFA
      Written by:
      How.com.vn Technology Writer
      This article was co-authored by How.com.vn staff writer, Nicole Levine, MFA. Nicole Levine is a Technology Writer and Editor for How.com.vn. She has more than 20 years of experience creating technical documentation and leading support teams at major web hosting and software companies. Nicole also holds an MFA in Creative Writing from Portland State University and teaches composition, fiction-writing, and zine-making at various institutions. This article has been viewed 1,772,570 times.
      How helpful is this?
      Co-authors: 23
      Updated: August 4, 2023
      Views: 1,772,570
      Article SummaryX

      1. Open the Windows Task Manager.
      2. Click Create Basic Task.
      3. Name the task.
      4. Select a frequency.
      5. Select a time/date.
      6. Select Start a program.
      7. Enter C:\Windows\System32\shutdown.exe as the program.
      8. Enter /s as the arguments.
      9. Click Finish.

      Did this summary help you?

      Thanks to all authors for creating a page that has been read 1,772,570 times.

      Reader Success Stories

      • How.com.vn English: Sandra Moosman

        Sandra Moosman

        Sep 16, 2019

        "Spent 3/4 of an hour trying to find out how to turn my computer off automatically. I found lots of traps,..." more
        Rated this article:
      Share your story

      Is this article up to date?

      ⚠️ Disclaimer:

      Content from Wiki How English language website. Text is available under the Creative Commons Attribution-Share Alike License; additional terms may apply.
      Wiki How does not encourage the violation of any laws, and cannot be responsible for any violations of such laws, should you link to this domain, or use, reproduce, or republish the information contained herein.

      Notices:
      • - A few of these subjects are frequently censored by educational, governmental, corporate, parental and other filtering schemes.
      • - Some articles may contain names, images, artworks or descriptions of events that some cultures restrict access to
      • - Please note: Wiki How does not give you opinion about the law, or advice about medical. If you need specific advice (for example, medical, legal, financial or risk management), please seek a professional who is licensed or knowledgeable in that area.
      • - Readers should not judge the importance of topics based on their coverage on Wiki How, nor think a topic is important just because it is the subject of a Wiki article.

      Advertisement