Automatic Reboot in Windows 10, Windows 8, or Windows 7 - PRR Computers, LLC

by Phil Rice
12 years ago
115370 Views

Restarting your computer periodically is a good idea, especially if it’s a computer that is left on much of the time. In Windows 10 (or Windows 8, or Windows 7), you can easily schedule an after hours reboot by following these steps:

  1. Press Start, and in the search box type “Task Scheduler.” Atop your list of choices will be the Task Scheduler. Click it.
  2. Click the Action menu and then select Create Basic task.
  3. Choose a name for the task (like AutoReboot), type it in the Name box and click Next.
  4. Select Daily (if you want a daily reboot) and click Next
  5. Type the time you want to restart the computer, set recurrence to your liking, and click Next.
  6. Select Start a program and click Next.
  7. Click Browse and navigate to %SystemRoot%\System32 (that’s going to be C:\Windows\System32 for most people). Find the file named Shutdown (.exe) and click Open. Type /F /R in the Add arguments (optional) box and click Next.
  8. Click Finish.

Now your computer will automatically restart at the date, time, and frequency you specified.

If you’re going to have a scheduled task like this in place, make sure to develop the habit of closing documents and programs when you’re done using them, so the reboot won’t close them for you and cause you to lose unsaved work.

Do you have multiple computers at a business that need maintenance tasks like this on a regular basis? A Managed Services Program is a great solution to get this responsibility delegated to a trusted professional so you can focus on running your business.

Tags: , ,

29 Comments

  • Kevin says:

    Thanks, found the information to be quite useful. I have implemented it on several system now.

  • Abdo Yamane says:

    It was very helpful.

    Thank you

  • Michael says:

    Thank you for your assistance.

  • John says:

    Tip: add “-t 60” & create a batch file separately on the desktop with “%SystemRoot%\System32\Shutdown.exe /a”, name it “Cancel Reboot.bat”. This way if u are working on the machine and the scheduled reboot comes up, just run that batch file to cancel. 🙂

  • Ben says:

    Arguments need to be /r /f instead of -r -f
    It worked other than that though, thanks.

  • Philja says:

    Automatically Restart Windows every night

  • Gabrielle says:

    I set my computer to do this a long time ago. I can’t remember how I did it. I don’t see anything in Task Scheduler. I’d really like to change the time it reboots. But I can’t seem to find where to do so. I’ve set up a new Action in Task Scheduler, but that may mean that my computer will reboot again at the original time.

    • Phil Rice says:

      Hi Gabrielle,

      If you know what time your computer was previously set to reboot, you might be able to find it based on that time. If you open Task Scheduler, and then click on “TASK SCHEDULER LIBRARY” on the left, the main window should show a list of all active tasks. Focus your attention on the “Triggers” column, you’ll see that most tasks probably mention a time of day in which they occur.

      If that doesn’t help, scroll to the right in that same window and look for the “AUTHOR” column. If you click the “Author” label at the top of that column, it will sort/group the tasks by their author. Any tasks created by you will stand out in that list because they will show an author that consists of your computer name and then your username, for example: GABRIELLE-PC\GABBY (just for example). That will help set your own manually created tasks apart from ones created by other programs and processes. NOTE: NOT ALL the tasks with this AUTHOR label will be ones you created… there very well may be some in there which you didn’t manually create too. But all the ones you DID manually create should show that author designation. Hope this helps!

  • Abdoulie says:

    Very useful information thanks for sharing. Anyway i know this is an old tread but i just want to ask does anyone know how to do something like this on a Domain in order to schedule restart all client computers on the domain? Am guessing there should be a way to set this up on the domain controller server but how can i do it without shutting down or restarting the server itself? Thanks in advance for any help.

  • rickkee says:

    Should it run under system account?
    How or can it run if user not logged in?

    • Phil Rice says:

      Rickkee, you should be able to have the task run under any account with administrative privileges. I don’t think the SYSTEM account will work well but you can try it.
      To get a task to run when the user isn’t logged in… after creating the task, go back into Task Scheduler and right-click the task and choose PROPERTIES. On the first “General” tab of Properties, near the bottom you should see some choices under Security Options. You’ll want to select “Run whether user is logged on or not” and “Run with highest privileges” to ensure the task will run even if you’re not logged on.

  • ravi says:

    Very helpful post.

  • matt says:

    Where can we check that the reboot actually occurred?

    • Phil Rice says:

      Hi Matt, you can check the Event Log (Event Viewer > Windows Logs > System) and look for (or filter by) event ID 6006. Event ID 6006 is triggered when the Event Log service is shut down, something that happens right before a shut down or restart. Pretty reliable indicator in my experience. FYI, Event ID 6005 is triggered when that same service starts up again, a decent indicator of when the system came back up from its reboot.

  • Tony says:

    To check the last reboot time, type “net stats srv” and scroll back to the top

  • Ernesto Carreras says:

    Is there a way to run this task but then log in as a specific user after the restart?

    • Phil Rice says:

      No, there is no way to do this that I am aware of.

    • Fate C. Jsin says:

      Open “run” box, type “netplwiz” & enter >

      Uncheck “Users must enter a user name and password to use this pc” or something like that, click OK >

      Now you should see a pop-up window asking for your username & pass. Just key in your specific user & pass and viola, done.

      To undo, simply relaunch netplwiz & recheck it.

  • Alex Mark says:

    Thank you, Phil for your instructions. However, it didn’t work for me. I followed the directions, but wanted to check if it works for me, that is why I set up not recurrent action but “once” and selected specific time (one minute later from current time). At scheduled time the quick window flashed on the screen, but computer (Win7 pro) actually didn’t do anything.
    Can you advise what can be wrong?

  • Quang says:

    Thanks,
    But, How to delete them (if we don’t need)

  • Jeff Tuttle says:

    Great tip, Phil! I have a Windows 7 HTPC I use as a DVR; Quad digital tuners, 6 TB HD with NAS backups, etc. How can I add an exception so the task does not run if Windows Media Center is recording? Thank you, Jeff

  • Phil says:

    Hi Jeff. The Windows task scheduler isn’t terribly versatile in terms of exceptions / conditions for running a task. To accomplish what you’re describing, I can think of two possible approaches.

    1) If you open the Properties of the task created using the steps outlined above, check out the “Conditions” tab. There is an option labeled “Start the task only if the computer idle for…” The big question here will be, how does Windows define “idle” with respect to Windows Media Center. If by chance Windows considers your machine to be in a not idle state when WMC is recording, then this might work great to get the task to not run during recording. If, however, Windows determines a computer’s “idle” status depending on user interaction (mouse/keyboard for example), then this won’t help. I know that on my HTPC, when we’re watching a movie – either streaming or a local file in VLC Media Player, the screen saver for the TV does NOT turn on, even if we go a long time without touching inputs. But with no video playing, the screen saver does turn on. I believe a screen saver in Windows relies on the same “idle” detector that scripts would… if so, recording should make the computer appear not idle and thus suspend this script if this option is turned on. But I don’t know for sure. It’s something you’ll need to test and see.

    2) The other option would be, instead of your task running the “shutdown” command directly as we did above, to instead make yourself a batch or script file to run that command, and then work into that batch/script some kind of logic that detects when WMC is recording. Maybe there is a specific process running on the computer when recording is active which you could detect and have your batch/script make a decision about whether to execute the shutdown command? The particulars of the script you’ll need to work out, or hire a freelancer to work out for you if scripting isn’t your thing. But in theory, there’s a good chance this could be made to work.

    Either way, if you have success with it, would love to have you return here and let us know how you fared. Best of luck!

  • Phil says:

    Hi Quang, sorry I am just now getting to your comment.

    A scheduled task can be removed by opening Task Scheduler, finding your task in the list, right-clicking on that task, and choosing either Disable (to stop it from running but not get rid of it permanently) or Delete (to get rid of it permanently).

  • Shah Mohammad Polash says:

    Hello
    Thanks for giving a solution of this issue. I found out your site. I can fix it following your step by step guide. Keep up the great work.

Leave a Reply

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