How to bulk uninstall windows updates on Shoretel Server


 We can use the Windows Management Instrumentation Console to get the information and then a bacth will bullk uninstall the windows updates. 

 Following the procedure, server updates will be bulk uninstall silently.

  1. Obtain the list of updates:
  2. wmic qfe get hotfixid >> c:\list.txt
    (This will get you the list of all updates that are currently installed.)
  3. Open C:\list.txt in Notepad. (Remove the first line: HotFixID, it's just the title)
  4. At this point, look for the Windows update Ex: KBXXXXXX you do not want to uninstall and remove from file "list.txt" and save it.
  5. Generate the uninstall script:
    for /f %i in ('type c:\list.txt') do echo wusa /uninstall /kb:%i /quiet /norestart >> c:\uninstall.cmd
  6. Now you have to edit the uninstall.cmd file and use text editor to edit the file(ex:notepad).
  7. Go to Edit > Replace and set the following field values: (Can use shorcut CTRL+H,). Replace "/kb:KBwith "/KB:", { replace just the text in the quotes}.
  8. Save the File uninstall.cmd and run that script from cmd.
  9. Reboot the Server after batch file is finished uninstalling the updates.

 NOTE: This is what the syntax should look like after you edit with CTRL+H.

 wusa /uninstall /KB:981391 /quiet /norestart

Article: 000012534