How to define a trigger to run when windows update kicks off?

Page 1 of 2 12 LastLast

  1. Posts : 5
    windows 10
       #1

    How to define a trigger to run when windows update kicks off?


    I have windows 10 Home which doesn't support options to control windows updates. It's not feasible for me to move to the PRO version just to have control over the updates as I have no need for the additional features. I'm looking for suggestions as to triggering a script to run just as the windows updating starts. Windows OS script? Powershell script? Task manager? I need to know the start, processing, status, and stop of the Windows update. I need to know that processing is not due to a virus, malware, intrusion,...
      My Computer


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

    Hi, what is it that you wish to do to Windows Update?

    You can hide individual updates (= block them) and if you are careful, that can apply to a particular feature update (upgrade) as well.

    Tutorials here support that.

    If you wish to stop updates altogether, there is a useful thread on that which you can find by searching for
    'stop windows update completely' (see link posted below).

    May I ask what your concern is in respect of Windows Updates?

    And then ... trigger when? When a check for updates starts? When the download starts? When the installation starts? I can't see the latter two being useful.
    Last edited by dalchina; 01 Aug 2018 at 10:37.
      My Computers


  3. Posts : 16,783
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #3

    Joanie,

    I do not think that the trigger exists. There are some triggers in Event viewer that you can use to launch your batch file but none of them are quite what you want [a trigger as the update starts].

    The nearest one to what you want is Microsoft-Windows-WindowsUpdateClient/Operational and is Event ID 26. This will give false alarms because it also happens when WU concludes that there are 0 updates to do and it will only be triggered for Windows updates but not for App updates [even those Apps that are included with Windows 10 by default].

    In Event viewer, you can use the option on the right-hand side to Attach a task to this event and you can use that task [which will be in Task scheduler] to run your batch file.

    Denis
      My Computer


  4. Posts : 16,783
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #4

    Joanie,

    On the other hand, you could reconsider what you have said that you want and take control of Windows Update instead. This, it seems to me, would suit you.

    There are several different approaches to controlling WU. My own approach is in my posts #73, #74 of this TenForums thread and you will see some of the other approaches if you read that very long discussion from the start.

    Denis
      My Computer


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

    Bear in mind this exists:
    How to define a trigger to run when windows update kicks off?-1.jpg
      My Computers


  6. Posts : 5
    windows 10
    Thread Starter
       #6

    Mainly, I'm looking to be notified when the Windows 10 update is starting, running, and has errored out or has completed successfully. After running Windows 10 for 2 months I decided to keep the windows automatic updates running. I'm looking to create a parallel process. I'll need to evaluate some suggestions from this thread.
      My Computer


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

    I see- I'm not sure what you would do with the information though- especially notification that an update is in progress. A failed update is notified anyway as you will know.

    Anyway.. note:
    Windows Modules Installer Worker(TiWorker.exe), a Windows Update Service, looks for new updates and installs it to your computer. In other words, when you're checking for Windows update or install Windows update on your computer, this process will be running automatically

    and

    TrustedInstaller.exe (TiWorker.exe) is a Windows service for the automatic installation of the Windows updates. It is a system process that enables automatic installation, modification, and removal of Windows updates and optional components.

    Given those two processes, it is relatively simple to write an Autohotkey (free, very well supported) script to
    a. detect a process is active
    b. generate a message

    in a continuous loop.

    I don't know how you could at that point identify which update was being applied.

    I suppose you could extend that to then test for the process NOT running, and when that was true, generate another message.
      My Computers


  8. Posts : 5
    windows 10
    Thread Starter
       #8

    Okay. I now have some options to try. And I ran through the "related threads" - seems my question isn't entirely unique.
      My Computer


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

    I've never come across anything like it personally... the nearest I can think of- and it's quite different- is the Notify setting in Pro that causes a notification that an update is pending, so the user can decide to do nothing at that point, open Settings by clicking on the notification to see what the update is, and then decide whether or not to download it. That's my preference.

    It used to be possible to do that in Home using a reg file, but MS has progressively reduced control of Windows Updates for Home and that is no longer possible. I remember reading that MS was to introduce more control but there seems no sign of this.
      My Computers


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

    Event id's related to Windows Update (these may not be complete- tried searching without much luck so looked at my Event Log using Nirsoft's FulleeventlogView tool).

    You can trigger a scheduled task based on Event ID.

    Event ID: 20 Source: WindowsUpdateAgent

    Source
    Windows Update Agent
    Level
    Error
    Description
    Installation Failure: Windows failed to install the following update with error <error code>: <update>.

    43 Information
    System Microsoft-Windows-WindowsUpdateClient
    Installation Started: Windows has started installing the following update: Definition Update for Windows Defender

    19 Information
    System Microsoft-Windows-WindowsUpdateClient Installation Successful: Windows successfully installed the following update: Definition Update for Windows Defender

    19 Information
    System Microsoft-Windows-WindowsUpdateClient Installation Successful: Windows successfully installed the following update: 9WZDNCRFHVQM-MICROSOFT.WINDOWSCOMMUNICATIONSAPPS


    44 Information
    System Microsoft-Windows-WindowsUpdateClient
    Windows Update started downloading an update.

    26 Information Microsoft-Win... Microsoft-Windows-WindowsUpdateClient Windows Update successfully found 0 updates.

    41 Information Microsoft-Win... Microsoft-Windows-WindowsUpdateClient An update was downloaded.
      My Computers


 

  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 13:59.
Find Us




Windows 10 Forums