News, tips, advice, support for Windows, Office, PCs & more. Tech help. No bull. We're community supported by donations from our Plus Members, and proud of it
Home icon Home icon Home icon Email icon RSS icon
  • Script that uninstalls all installed versions of KB2952664, KB2976978, KB2977759

    Posted on MrBrian Comment on the AskWoody Lounge

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

    This topic contains 19 replies, has 5 voices, and was last updated by  MrBrian 2 years, 5 months ago.

    • Author
      Posts
    • #111462 Reply

      MrBrian
      AskWoody_MVP

      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.

       

      Directions:

      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.
    • #111474 Reply

      abbodi86
      AskWoody_MVP

      Thanks

       

      not trying to hijack your thread, but dism is more reliable and doesn’t require all that many times looping wildly 🙂
      https://pastebin.com/wg3w9kfA

      you can add any update number to list

       

       

      4 users thanked author for this post.
      • #111492 Reply

        ch100
        AskWoody_MVP

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

        • #111498 Reply

          abbodi86
          AskWoody_MVP

          Just to check admin rights, so the script won’t be executed without it

          1 user thanked author for this post.
      • #111502 Reply

        AlexN
        AskWoody Lounger

        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 Reply

          abbodi86
          AskWoody_MVP

          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”

          3 users thanked author for this post.
          • #111529 Reply

            ch100
            AskWoody_MVP

            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 Reply

        MrBrian
        AskWoody_MVP

        Thank you for your script :).

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

        • #111515 Reply

          ch100
          AskWoody_MVP

          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 Reply

        MrBrian
        AskWoody_MVP
        • #111620 Reply

          abbodi86
          AskWoody_MVP

          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 Reply

          ch100
          AskWoody_MVP

          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 Reply

            MrBrian
            AskWoody_MVP

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

          • #112571 Reply

            MrBrian
            AskWoody_MVP

            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 Reply

        MrBrian
        AskWoody_MVP

        @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 Reply

      radosuaf
      AskWoody Lounger

      Nice!

      MSI H110 PC MATE * Intel Core i5-6402P * 2 x 8 GB Corsair Vengeance LPX DDR4 2133 MHz * Aorus Radeon RX 570 4GB * Samsung 840 EVO 250GB SSD * Western Digital Blue 1TB HDD * Seagate Barracuda 1TB HDD * DVD RW Lite-ON iHAS 124 * Creative X-Fi XtremeGamer PCI * Windows 10 Pro 1809 64-bit
    • #111490 Reply

      ch100
      AskWoody_MVP

      @mrbrian

      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 Reply

        MrBrian
        AskWoody_MVP

        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 Reply

          ch100
          AskWoody_MVP

          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 Reply

        MrBrian
        AskWoody_MVP

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

        1 user thanked author for this post.

    Please follow the -Lounge Rules- no personal attacks, no swearing, and politics/religion are relegated to the Rants forum.

    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 Advanced BBCodes, they will be stripped before saving.