Running wusa /uninstall /kb:5032007 /quiet /norestart error (CMD )

while running this command as admin. uninstall kb is not happening, logging in eventID 8.

wusa /uninstall /kb:5032007 
/quiet /norestart

i have windows 11 with AMD64 machine.

if run without quiet and noreatart patch uninstallation will work.

i want to include this in python script. however uninstallation of kb number not working with /quiet /norestart.

if somebody helps, that would be gratefull.

i tried all possible way. but wusa not working

import subprocess
kb_number = "5032007"
command = f"wusa /uninstall /kb:{kb_number} /quiet /norestart"
try:
result = subprocess.run(command, check=True, shell=True)
print("Update uninstalled successfully.")
except subprocess.CalledProcessError as e:
print(f"Error: {e}")

I would like to run wusa command in subprocess. And while uninstalling i would like to capture system event logs for the special task added in event.

Solution

The wusa tool usage to quietly uninstall an update has been deprecated. The uninstall command with /quiet switch fails with event ID 8 in the Setup event log

https://learn.microsoft.com/en-us/windows/whats-new/deprecated-features

A powershell alternative can be:

Get-WindowsPackage -Online -PackageName "*KB5032007*" |

Leave a Reply