Windows – Batch file to uninstall windows update

batchwindowswsus

Is it possible to make a batch file to uninstall a specific windows update (eg. KBxxxxxx)? We use 20 year old web based software to enter hours where I work and a new update is causing the program to crash. The update was blocked on our wsus server, but quite a few machines pulled the update before it was blocked. (we should just move to new software, but unfortunate this is not an option). Any help would be greatly appreciated.

Best Answer

Yes, it is. It's largely the same process for installing an update or application with a batch file. (Unfortunately I don't have an example lying around at the moment, since I stopped doing that long ago, and use one of the other methods below.)

Since you mention a WSUS server, I should point out that it's actually a much better idea to uninstall the update through your WSUS server than with a batch file or script. It's safer because it's less likely to result in a botched uninstall or a partial uninstall.

Approval actions include the following:

    Install
    Remove (this action is possible only if the update supports uninstall)
    Detect-only
    Decline

(So set the update's approval status to "remove.")

If you're deadest on a scripted solution, though, and have PowerShell, the Scripting Guy has an example of how to do it with PowerShell.