Batch Uninstall Windows Updates

This post shows how to programmatically automatize the batch uninstall of multiple Windows Update hotfixes on Windows version 8 and below. The code samples are in AutoHotKey syntax, and you can get the full source code, as well as compiled executables ready to run, on the Windows Updates Uninstaller Utility online repository.

Listing the Updates

The simplest way to get a list of the installed Windows Updates is through WMIC, which is an internal Windows command-line interface for accessing management functions. Using the QFE module, we can generate a list by running the following command, for example from the Command Console: wmic qfe get "HotFixID" /format:table This will list the installed updates directly in the console, like this: updates list on console It’s easier to parse them from a text file, and luckily our friend QFE can do that for us too with the following command: wmic qfe list brief /format:texttablewsys >"%Path_of_the_text_file%" where %Path_of_the_text_file% is what it says, the path of the text file to be created, such as C:\hotfix.txt for example, or wherever. When listing in a file, it won’t list individual columns but the whole table, so you’ll need to use character offsets when parsing columns.

Uninstalling the Updates

To uninstall each update, the easiest way is to use WUSA, which is a built in Windows utility for managing Windows Updates. Since you already have a list of the installed updates, you just need to extract the hotfix ID number from each row, and run the following command for each update: wusa.exe /kb:%HotfixId% /uninstall /quiet /norestart where %HotfixId% is the hotfix ID number. For example, to uninstall update KB279503 you need to run the following: wusa.exe /kb:279503 /uninstall /quiet /norestart and so on. Since uninstalling each update takes time, you should wait for one uninstall to end before beginning the next one. If you’re using AutoHotKey, you can simply use the RunWait command and it will wait for each execution to finish before starting the next one.

Putting it all together

The essence is simple: get the list of updates, parse it to retrieve the hotfix IDs, and uninstall them one by one. If you’re into AutoHotKey, it’s pretty easy to do, as you can see at the Windows Updates Uninstaller Utility online repository. There you’ll find an AutoHotKey implementation with a basic GUI, in both source-code and compiled executable form, so you can toy with the code or use as-is.

11 thoughts on “Batch Uninstall Windows Updates

  1. Here’s a PowerShell script I made to remove the Windows 7 to Windows 10 privacy violating security updates:

    $updates = wmic qfe list /format:csv|convertfrom-csv
    if ($updates.hotfixid -like “*2990214*”){start-process “c:\windows\system32\wusa.exe” -wait -nonewwindow -argumentlist “/uninstall /kb:2990214 /norestart”}
    if ($updates.hotfixid -like “*2952664*”){start-process “c:\windows\system32\wusa.exe” -wait -nonewwindow -argumentlist “/uninstall /kb:2952664 /norestart”}
    if ($updates.hotfixid -like “*3021917*”){start-process “c:\windows\system32\wusa.exe” -wait -nonewwindow -argumentlist “/uninstall /kb:3021917 /norestart”}
    if ($updates.hotfixid -like “*3022345*”){start-process “c:\windows\system32\wusa.exe” -wait -nonewwindow -argumentlist “/uninstall /kb:3022345 /norestart”}
    if ($updates.hotfixid -like “*3035583*”){start-process “c:\windows\system32\wusa.exe” -wait -nonewwindow -argumentlist “/uninstall /kb:3035583 /norestart”}
    if ($updates.hotfixid -like “*3068708*”){start-process “c:\windows\system32\wusa.exe” -wait -nonewwindow -argumentlist “/uninstall /kb:3068708 /norestart”}
    if ($updates.hotfixid -like “*3075249*”){start-process “c:\windows\system32\wusa.exe” -wait -nonewwindow -argumentlist “/uninstall /kb:3075249 /norestart”}
    if ($updates.hotfixid -like “*3080149*”){start-process “c:\windows\system32\wusa.exe” -wait -nonewwindow -argumentlist “/uninstall /kb:3080149 /norestart”}

    Here’s the reference article explaining the Windows 7 security changes due to supporting a Windows 10 upgrade:
    http://www.wilderssecurity.com/threads/list-of-windows-7-telemetry-updates-to-avoid.379151/

    • Hi, if you had read the article with greater care you might have noticed that I’m even linking to a tool I made to uninstall practically all updates in just a couple of clicks, using the method I describe. Hell, I was hoping the “Batch” part of the post’s title itself might clue you in. However, the method you link to does seem more straightforward from the do-it-yourself-instead-of-installing-some-random-software perspective, so thanks for sharing!

  2. For me, the Windows Updates Uninstaller didn’t work.

    Instead, I had to make a batch file to delete them.
    Fortunately, I got to make it in just 1 batch.

    @echo off
    setlocal enabledelayedexpansion

    echo “Creating Hotfix & Updates list.”
    (for /f “delims=” %%a in (‘wmic qfe get “HotFixID” ^| findstr [0-9]’) do (
    set “$Line=%%a”
    echo !$Line:~2!))>%~dp0temp.txt

    for /f %%i in (‘type %~dp0temp.txt’) do (
    echo “Uninstalling KB%%i”
    wusa /uninstall /kb:%%i /quiet /norestart
    )
    echo “Uninstallations Complete.”
    echo “Deleting temporary files…”
    del %~dp0temp.txt
    echo.echo “Done”
    echo.echo “Rebooting…”
    echo.
    shutdown /r

  3. Very nice. Does the job. Thank you so much. It saved me a lot of time. I think microsoft should add it as a feature.

  4. I simply extracted the KB numbers from the file using excel then added the commands before and after the KB number using excel replace tool and then saved all the generated commands in a batch file and executed it and watched all the updates uninstall at once like a boss. Thanks for the commands though… 🙂

  5. Thanks, Windows update broke my connection to an older version of my Exchange server. It was driving me crazy. I installed an original Win7 on a spare computer and it had no trouble with my Exchange server. I allowed it to do the updates and lo-and-behold, it started acting up.too. Pisses me off.

    • Hi, the ahk file is the source code, you can compile it using AutoHotKey, or you can download the compiled executable directly from the Releases section at the GitHub page.

Leave a Reply

Your email address will not be published. Required fields are marked *