Scheduling Windows Updates Through Task Scheduler


  1. Posts : 30,120
    Windows 11 Pro x64 Version 23H2
       #1

    Scheduling Windows Updates Through Task Scheduler


    I'd like to be able to run Windows updates each day at 2:00am. I need to move them to non productive hours.

    I read the posting by Brink on setting the Automated Updates. I confirmed my settings and ensured my wake timers (under Sleep in Advanced Power Options) is set to enabled. It doesn't run which I confirmed by opening settings and I can see the last time it checked for updates is not 2:00am, it is when I did a manual check.

    I'm running Windows Home 10 so the group policy solution also posted doesn't work. I found this command "control.exe /name Microsoft.WindowUpdate" and while it will invoke updates in a CMD window I don't have sufficient permissions within task scheduler. This is interesting as I set the task with an admin id and confirmed twice that the "Run with highest privileges" box is tick. Now when I open the command prompt manually I do invoke as admin.

    Does anyone have a command or a possible solution to this issue. I liked Brink's idea of just using Windows to do the job but can't understand why the "Last Time Checked" wasn't updated.

    Any help would be appreciated. I've enclosed the error from the event viewer. In Task scheduler it ends on a (0x1).
      My Computer


  2. Posts : 42,735
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #2

    Hi, this doesn't directly answer your question, which is harder to answer as you lack the Group policy editor, but it may contribute to it.

    I understand that not only would you wish to control restarts related to updates but also the download of updates.

    In scheduling a scan for windows updates so these are downloaded at only a particular time, you would also need to inhibit the normal feature. One way of doing this is given here: (note the registry method is at the end, before you say you haven't got the Pro version).
    http://www.thewindowsclub.com/make-w...indows-updates

    Considering your scheduled task, presumably you have done sth like this:

    1. Open Task Scheduler

    2. Create a new task
    3. In the "General" tab - ensure the following settings are entered:

      • "Run whether user is logged on or not"
      • "Run with highest privileges"
      • "Configure For" (your operating system)

    4. In the "Triggers" tab, when adding a trigger (schedule) - ensure that the "Enabled" checkbox is checked

    The other tabs need to be looked at as well (actions etc) - but these are the options you should specify when trying to ensure a task runs regardless of which user is logged in, and without the UAC prompts.


    When saving the task, you will be prompted to enter a username and password - this username and password is the user that will be used to execute the task. If you are running the task with "highest privileges" you will need to make sure this is an admin account.


      My Computers


  3. Posts : 30,120
    Windows 11 Pro x64 Version 23H2
    Thread Starter
       #3

    Thanks. I'm not that concerned about the restarts, its the drain on bandwidth. I'll check the other tabs, otherwise I have everything set up as you described. The tasks is running, event log shows computer awakening, shows the task ran, so the "Run whether users is logged on or not" is set, checked highest privileges and configured for Windows 10. Confirmed it is an admin id, as I must enter my password and the check is checked to run with highest privileges. I can run the command line from a "Prompt with Admin rights" it just doesn't seem to have authority in task scheduler.

    Thanks for responding. I will check all tabs again.
      My Computer


  4. Posts : 42,735
    Win 10 Pro (22H2) (2nd PC is 22H2)
       #4

    You can of course run the scheduled task at any time for test purposes- rt click it and run.

    Note the link in my first para to disable downloading.

    Else you need to find what triggers the normal Windows update scan, and disable that. I know which scheduled task is responsible for the 4 hourly apps update check (that's another download!) but not that one.
      My Computers


  5. Posts : 30,120
    Windows 11 Pro x64 Version 23H2
    Thread Starter
       #5

    Thanks. Yes I did try running manually and got same failure.

    Agree, I'm looking for command to kick off updates. The one I found works from a Command prompt but not scheduler. The other way is I'm hoping someone will know how to elevate the permissions in scheduler so it will run.

    While not pretty I was even thinking of creating a bat file or cmd file and calling that file from the scheduler.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 19:11.
Find Us




Windows 10 Forums