• Script that uninstalls all installed versions of KB2952664, KB2976978, KB2977759

    Home » Forums » AskWoody support » Windows » Windows – other » Script that uninstalls all installed versions of KB2952664, KB2976978, KB2977759


    I wrote a script that uninstalls all installed versions of Windows 7, 8, and 8.1 telemetry-related updates KB2952664, KB2976978, and KB2977759. I have tested that it works for KB2952664 on Windows 7. Credit for basic idea: https://www.ghacks.net/2015/04/17/how-to-remove-windows-10-upgrade-updates-in-windows-7-and-8/#comment-3934849.



    1. Press download button at https://pastebin.com/iqPiu3iU and save it.

    2. Move the file saved in step 1 to desired location, rename it to desired name, and change file extension to .cmd.

    3. Open elevated command prompt.

    4. Use cd command to change to folder location of file from step 2.

    5. Type name of file from step 2 and press Enter key to run it.

    4 users thanked author for this post.
    Viewing 2 reply threads
    • #111474



      not trying to hijack your thread, but dism is more reliable and doesn’t require all that many times looping wildly 🙂

      you can add any update number to list



      4 users thanked author for this post.
      • #111492

        What is the reason to query the registry for the Local Service account?

      • #111502

        I got told that “KB2976978 is necessary for this computer and cannot be uninstalled”

        Fortran, C++, R, Python, Java, Matlab, HTML, CSS, etc.... coding is fun!
        A weatherman that can code

        • #111503

          Latest official Windows 8.1 with update ISO/ESD (released in December 2014) contains an old version of KB2976978
          which is permanent because the whole install image is reset-based (updates integrated and WinSxS cleaned of old components)

          it cannot be uninstalled normally, so you will have to live with it and disable the related schedule tasks at:
          “\Microsoft\Windows\Application Experience”

          4 users thanked author for this post.
          • #111529

            Windows 10 has the functionality built-in, Windows Server 2016 has the functionality built-in (while old server versions do not get it as a patch), Windows 8.1 has it in the latest official image offered to enterprises as per @abbodi86 ‘s post, so I am not sure if KB2952664/KB3150513 and their equivalent patches for other OS should be interpreted as harmful or undesired any longer.
            In Windows 10, I noticed that compattelrunner.exe process runs for few seconds immediately after any software installation.
            I do not block the specific telemetry tasks in Windows 10, other than setting the policy on Basic/Security subject to availability based on edition.
            I don’t consider any of the Home versions usable (including Windows 7) from my point of view, so this applies to Pro and higher editions.

      • #111510

        Thank you for your script :).

        : Could you elaborate on “dism is more reliable”?

        • #111515

          I will try to answer this one.
          DISM is the real thing, while msu patches have an installer wrapped around the patch to make it user friendly.
          There are known instances when after running msu uninstall, there are still leftovers left behind the uninstall. This happens mostly with corrupt installations and CBS, but it happens.
          DISM would either do the cleanup or announce if not able to do it, due to flags in the patches for example.

          4 users thanked author for this post.
      • #111612
        • #111620

          I didn’t face such behavior, not in Windows 7 at least

          Windows 8.1 have issues sometimes because of the built-in feature to reduce WinSxS store (remove or compress old components)

          1 user thanked author for this post.
        • #111654

          There must be something unusual happening on Graham’s machine.
          I would think that the most reliable order of uninstallation for anything regardless of the method used is from the newest to the oldest. This would avoid interdependencies and would bring the old patch back correctly after uninstalling the newest one.

          • #112523

            I agree, and that’s why I still use wusa.exe in the latest version of my script (not yet posted).

          • #112571

            Using a baseline of 5 installed versions of KB2952664 for each test, I did 4 tests using a modified version of my script that used 1 iteration of wusa.exe, 2 iterations of wusa.exe, 3 iterations of wusa.exe, and 4 iterations of wusa.exe, respectively. In each case, the script removed versions of KB2952664 in the desired order, from newest, to next newest, etc.

      • #111613

        @abbodi86: Here are a few issues you may wish to consider fixing in your script:

        1. To avoid situations such as removing update kb12345678 when the user wanted to delete update kb1234567, replace findstr %%G Packs.txt with findstr KB%%G~ Packs.txt

        2. Delete file ToRemove.txt near beginning of script in case it wasn’t deleted in a previous run.

        3 users thanked author for this post.
    • #111479


      Antec P7 Silent * Corsair RM550x * ASUS TUF GAMING B560M-PLUS * Intel Core i5-11400F * 4 x 8 GB G.Skill Aegis DDR4 3200 MHz CL16 * Sapphire Radeon 6700 10GB * XPG GAMMIX S70 BLADE 1TB * SanDisk Ultra 3D 1TB * DVD RW Lite-ON iHAS 124 * Windows 10 Pro 22H2 64-bit
    • #111490


      I think it would be a good idea to add a sequence to uninstall KB3150513 first, before any of those patches.
      There are multiple versions of KB3150513 and multiple versions of KB2952664 and I don’t exactly know the interaction between versions. What I mean to say is that I don’t know what is the behaviour if a later version of KB3150513 is uninstalled and after that KB2952664 is uninstalled. Would that make an older KB3150513 visible?
      Anyway, such a script updated to include KB3150513 running multiple times should do the complete job.

      1 user thanked author for this post.
      • #111511

        Thanks for the suggestion :).

        Is there any evidence that having KB3150513 installed without KB2952664 installed is cause for concern?

        1 user thanked author for this post.
        • #111513

          It may get hidden after uninstalling KB2952664 or even uninstalled.
          I don’t know as I am not overly concerned about any of the patches.
          It is only natural to uninstall in the order of installing and as KB2952664 is a prerequisite, then there may be hidden dependencies causing problems or slowdowns in the background.
          Those are only assumptions though.

          2 users thanked author for this post.
      • #111765

        @ch100: The next version of my script will uninstall KB3150513.

        1 user thanked author for this post.
    Viewing 2 reply threads
    Reply To: Script that uninstalls all installed versions of KB2952664, KB2976978, KB2977759

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: