Script for removing Windows 7 updates that should “ease the upgrade to Windows 10”

For those who are running Windows 7 and (just like me) don’t want to upgrade to Windows 10, here’s a script to remove all Microsoft updates contributing to the upgrade. It fetches the documentation for all installed updates (not security related and starting from 2015) and looks for certain keywords inside that documentation. Currently it removes everything mentioning “Windows 10”, “ease the upgrade experience”, “upgrading” or “telemetry”. You can change this to your own words inside the script.
Note, this should also remove KB3035583 that gives the Windows 10 upgrade icon in the taskbar. That tray icon should be gone after running the script.
It also tries to remove all telemetry features which collects all sorts of user activity and sends it to Microsoft. It is enabled in Windows 10 by default and Microsoft hasn’t provided an option to completely disable it for Home and Pro users. Some telemetry updates are installed in Windows 7 as well, for example KB3068708.

The script is written in Python2. If you don’t have it, install the latest version here: I have only tried it on Windows 7 x86, but it probably works on 8(.1) and 64-bit as well.

import subprocess
import urllib2
import sys
import time

keywords = [" ease the upgrade experience ", " Windows 10 ", " upgrading ", " telemetry "] #keywords to look for inside the documentation
startKB = 0 #start from a certain KB number

removing = []
kbs = []

def run_command(command):
    p = subprocess.Popen(command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
    return iter(p.stdout.readline, b'')

print "Getting installed updates list..."
command = 'wmic qfe list'.split()
for line in run_command(command):
     for str in line.split(" "):
          if str.startswith("KB") and not "Security Update" in line and "2015" in line:
               kb = str[2:]
               if int(kb) > int(startKB):

print "Found %s updates" % (len(kbs))
print "Fetching KB documentations (this might take a while)..."
for kb in kbs:
    url = ""+kb
    req = urllib2.Request(url)
        f = urllib2.urlopen(req)
        html =
        if any(x in html for x in keywords):
            print "[%i] KB%s: Bad, see %s" % (i, kb, url)
            print "[%i] KB%s: Good" % (i, kb)
    except urllib2.URLError as e:
        print "[%i] KB%s: %s" % (i, kb, e.reason)

if len(removing) == 0:
    print "Nothing found!"

print "Ready to remove following updates:"
print removing
print "They will be uninstalled one by one. You can choose individually whether you want it removed or not."
proceed =  raw_input("Continue? [Y,n] ")
if (proceed == "") or (proceed == "y") or (proceed == "Y") or (proceed == "yes"):
    for kb in removing:
        print "Removing KB%s..." % kb["wusa.exe","/uninstall","/kb:"+kb,"/norestart"], shell=True)