[Product] #CheckWUSA, DONTDELETE #Set:Product, DONTDELETE [CheckWUSA] Set VM_WUSA=%HKLM,"SYSTEM\CurrentControlSet\Services\wuauserv","Start"% If "%VM_WUSA%" == "4" Then "EnableWUSA" EndIf [EnableWUSA] CallHidden sc config "wuauserv" start= demand error= ignore [Set:Product] SET QFE=2918614 Addmeter -1 DEL "%TEMP%\qfe.txt" Callhidden %comspec% /C ECHO %sysdate% %systime% - Searching for installed hotfix: %qfe% >>"%WINDIR%\TEMP\qfe_uninstall.log" Callhidden %comspec% /C wmic.exe qfe >"%TEMP%\qfe.txt" If DoesTextInFileExist ("%QFE%", "%TEMP%\qfe.txt") == "1" Then "UninstallQFE" ELSE "QFEnotExist" EndIf [UninstallQFE] Callhidden %comspec% /C ECHO %sysdate% %systime% - Installed hotfix found: %qfe% >>"%WINDIR%\TEMP\qfe_uninstall.log" Callhidden %comspec% /C ECHO %sysdate% %systime% - Uninstall hotfix: %qfe% >>"%WINDIR%\TEMP\qfe_uninstall.log" CallHidden sc config "wuauserv" start= demand error= ignore Callhidden wusa /uninstall /kb:%QFE% /quiet /norestart Set WusaError=%ErrorLevel% IF %wusaError% == "3010" Then "RebootRequired" EndIf Callhidden %comspec% /C ECHO %sysdate% %systime% - ErrorLevel: %WusaError% >>"%WINDIR%\TEMP\qfe_uninstall.log" Callhidden %comspec% /C wmic.exe qfe >"%TEMP%\qfe.txt" If DoesTextInFileExist ("%QFE%", "%TEMP%\qfe.txt") == "1" Then "SET:InstallationError" EndIf Callhidden %comspec% /C ECHO %sysdate% %systime% - Successfully uninstalled hotfix: %qfe% >>"%WINDIR%\TEMP\qfe_uninstall.log" DEL "%TEMP%\qfe.txt" [QFEnotExist] Callhidden %comspec% /C ECHO %sysdate% %systime% - The following hotfix is not installed: %qfe% >>"%WINDIR%\TEMP\qfe_uninstall.log" [RebootRequired] SetReboot 1 [SET:InstallationError] Callhidden %comspec% /C ECHO %sysdate% %systime% - Failed uninstall hotfix: %qfe% >>"%WINDIR%\TEM\qfe_uninstall.log" ErrorLogMsg %ErrorText% %WusaError% %CallingText% wusa /uninstall /kb:%QFE% /quiet Abort