Does Windows provide a way to uninstall security updates via command line?

Basically, what can achieved by going to Control Panel > Uninstall a Program > View Installed Updates > Right Click Uninstall but from the command line. Maybe pass this tool a KB# or update title?

 And preferably a tool that is included in Windows.

Thanks!
 

Question Info


Last updated July 26, 2019 Views 45,128 Applies to:
Answer
Answer

Hi,

 

Yes, Windows updates can be uninstalled via command line.

 

Uninstallation can be done using wusa and pkgmgr commands.

 

Please follow the methods:

 

Method 1:

 

Using WUSA Command:

 

Step 1:

 

a. Click on Start menu, click on Run.

b. In Run type as cmd.exe with elevated previlliges (right click on cmd.exe and choose "run as administrator") and type:

wusa /uninstall /kb:{update ID}

Example:

To uninstall update KB980302 the command will be following

wusa /uninstall /kb:980302

 

Step 2:

 

a. Download problematic update from Microsoft Download Center and place it to any folder i.e C:\Temp

b. Run cmd.exe with elevated previlliges (right click on cmd.exe and choose "run as administrator") and type:

wusa /uninstall {full hotfix name}

Example:

To uninstall update KB980302 32bit and in C:\Temp folder you have standalone version the command will be following

wusa /uninstall C:\Temp\Windows6.1-KB980302-x86.msu

 

Method 2:

 

USING PKGMGR COMMAND:

 

UNINSTALLING UPDATE:



a. Download problematic update from Microsoft Download Center and place it to any folder i.e C:\Temp

b. Run cmd.exe with elevated previlliges (right click on cmd.exe and choose "run as administrator")
c. Unpack update by using command prompt

the proper commands are following:

expand -f:*{update name}.msu {destination folder}

i.e

To unpack update Windows6.1-KB980302-x86.msu which is stored in C:\Temp folder and you want to unpack it to C:\Temp2 folder the command will be following

expand -f:* C:\TEMP\Windows6.1-KB980302-x86.msu C:\TEMP2

press ENTER

d.Choose any unused empty folder or create new folder i.e C:\Sandbox for temporary installation files.
e.Now you can uninstall update,the proper command have following form:

start /w pkgmgr /m:{full hotfix name}.cab /up /s:{sandobox folder}

where {sandbox folder} -any unused folder

For our example,the proper command will be following:

start /w pkgmgr /m:C:\Temp2\Windows6.1-KB980302-x86.cab /up /s:C:\Sandbox

press ENTER

Dependce from what kind of update it is -sometimes after a while appear popup to prompt reboot to apply changes or if any update doesn't require reboot to apply changes no messages are returned.Don't close command prompt until it finish.

 

Hope this helps.

 

10 people were helped by this reply

·

Did this solve your problem?

Sorry this didn't help.

Great! Thanks for marking this as the answer.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this response?

Thanks for your feedback.