Rebooting Windows with a scheduled task

Creating a scheduled task to reboot your Windows machine once a week or nightly may help avoid issues such as high CPU or ram, frozen applications, or older hardware that could benefit from frequent reboots.

Creating the scheduled task

  1. Logon to the machine with an account with admin rights
  2. Open Task SchedularActionCreate Task
    1. In the GENERAL tab: Scheduled reboot GENERAL tab
      1. Name: Reboot Server Nightly (or name it whatever you want)
      2. Author: Administrator
      3. Description: Reboot Server Nightly at #pm
      4. Security Options:
        1. Select: Run whether user is logged on or not
        2. Seelct: Run with highest privileges
    2. In the TRIGGERS tab: Scheduled reboot TRIGGERS tab
      1. In Settings, select Daily, and enter the desired start date/time.
      2. In Advanced Settings, make sure Enabled is slected at the bottom.
    3. In the ACTIONS tab: Scheduled reboot ACTIONS tab
      1. Action: Start a program
      2. In "Program/script" field, enter c:\Windows\System32\shutdown.exe
      3. In "Add arguments (optional)" field, enter /r
  3. If you want to see the last time the server was rebooted, you can use the systeminfo command. For example:
    systeminfo | find /i "Boot Time"
    System Boot Time:              07/06/2022, 22:00:00

WARNING: The scheduled task will reboot the machine even with active users using the system — users will get message on their desktop saying "you will be signed out automatically"