Professional Documents
Culture Documents
How To Uninstall Specific Windows Updates Via CMD or Batch File in Windows 7 - 8 and Server 2008 - 2012
How To Uninstall Specific Windows Updates Via CMD or Batch File in Windows 7 - 8 and Server 2008 - 2012
How To Uninstall Specific Windows Updates Via CMD or Batch File in Windows 7 - 8 and Server 2008 - 2012
How to: Uninstall specific Windows Updates via CMD or batch file in
Windows 7/8 and Server 2008/2012
Ed Grauel
May 30, 2013 1 Minute Read
Spice (25)
Reply (14)
Subscribe
Share
The wusa command allows admins to uninstall specific Windows Updates from a CMD prompt or by use of a
batch file.
I have found this useful to remove IE Cumulative Security Updates that cause compatibility issues with legacy
Java applications, and will use the KB for an IE 8 Cumulative Security Update as an example.
3 Steps total
Step 1: Locate KB number of the patch you wish to
uninstall
Open Programs and Features from the Control Panel of a system that has the desired update installed and
click "View Installed Updates" and locate the update. The KB number will be listed in parenthesis at the end of
the name.
This will run the uninstall without any open windows, and will not prompt for a reboot:
@echo off
wusa /uninstall /kb:2744842 /quiet /norestart
END
If you are manually running the script on a number of computers that you want to reboot after the uninstall,
just change the /norestart switch to /forcestart:
@echo off
wusa /uninstall /kb:2744842 /quiet /forcestart
END
References
Microsoft Description of the WUSA Command
Cookies help us deliver our services. By using our services you agree to our use of cookies.
Ok
Follow
Ed Grauel
Ed GrauelNetwork/Systems AdministratorCleveland, OH11 years in IT
1832
Contributions
73
Best Answers
54
Helpful Posts
16
Projects
14 Comments
Now that Microsoft released a fixed version of KB3097877 uninstalling shouldn't be necessary but I
updated my original script to show how to completely remove the packages left behind so an update
wouldn't automatically get reinstalled after the next boot. The script assumes the current user is
administrator but could be edited for any user. This may come in handy for the next update that MS
botches :-)
@echo off
if exist c:\windows\servicing\packages\package_for_KB3097877* (
echo Found updates that must be removed, please wait...
wusa /uninstall /kb:3097877 /quiet /norestart
takeown /F c:\windows\servicing\packages\*KB3097877*.*
icacls c:\windows\servicing\packages\*KB3097877*.* /grant Administrator:D
del c:\windows\servicing\packages\*KB3097877*.*
shutdown /r /f /t 60 /c "Windows will restart in one minute, save your work and close your files now!"
) ELSE (
echo No updates need to be removed
)
Ok
Lauren7060 Nov 13, 2015 at 11:53am
I am trying to remove KB3097877 using WinPE command line and the wusa /uninstall /kb:3097877. When I
run this I get the error The subsystem needed to supper the image type is not present. Ideas?!?
One thing i'd like to add to your script is the PAUSE option at the bottom past the end closing parenthesis.
Not sure if this happens on everyone's systems, but on my test computer if KB3097877 is not installed the
CMD window just closes instantly and users / support staff never see the "No updates need to be
removed". With the PAUSE there you get a press any key to continue message which is end user friendly :-)
I didn't add a pause to the script because in our environment this script was just being called by our
primary login script and I try to keep user interaction to a minimum. I really only added the "No updates
needed to be removed" for myself so I could see if the script was working. Of course there is no harm in
adding a pause if you like to see the message. :-)
@echo off
if exist c:\windows\servicing\packages\package_for_KB2868116* (
echo Found updates that must be removed, please wait...
wusa /uninstall /kb:KB2868116 /quiet /norestart
takeown /F c:\windows\servicing\packages\*KB2868116*.*
Cookies help us deliver our services. By using /grant
icacls c:\windows\servicing\packages\*KB2868116*.* our services you agree to our use of cookies.
Administrator:d
del c:\windows\servicing\packages\*KB2868116*.*
Okclose your files now!"
shutdown /r /f /t 60 /c "Windows will restart in one minute, save your work and
) ELSE (
echo No updates need to be removed
)
C:\windows\system32>c:\2868116
Found updates that must be removed, please wait...
When I created the script I was logged in using the built in Administrator account.
https://community.spiceworks.com/topic/368007-runas-batch-including-password?page=1
Cookies help us deliver our services. By using our services you agree to our use of cookies.
Ok
ronboswell Jul 19, 2016 at 12:27pm
Computer startup scripts run with local admin rights by default, so I would just run it as a startup script
instead of a login script.
Cookies help us deliver our services. By using our services you agree to our use of cookies.
Ok