{"record":{"id":"71f6ef8da8d10fda","repo":"BCUninstaller/Bulk-Crap-Uninstaller","slug":"selected-update-is-not-uninstallable","errorCode":null,"errorMessage":"Selected update is not uninstallable","messagePattern":"Selected update is not uninstallable","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"warning","filePath":"source/WinUpdateHelper/UpdateManager.cs","lineNumber":30,"sourceCode":"using WUApiLib;\r\n\r\nnamespace WinUpdateHelper\r\n{\r\n    internal static class UpdateManager\r\n    {\r\n        public static void UninstallUpdate(string updateId)\r\n        {\r\n            Console.WriteLine(\"Scanning updates...\");\r\n            var wuaSession = new UpdateSessionClass();\r\n            var wuaSearcher = wuaSession.CreateUpdateSearcher();\r\n            var wuaSearch =\r\n                wuaSearcher.Search($\"Type='Software' and IsInstalled=1 and UpdateID='{updateId}' and IsPresent=1\");\r\n            var updates = wuaSearch.Updates.OfType<IUpdate>().ToList();\r\n            if (!updates.Any())\r\n                throw new ArgumentException(\"Selected update was not found\");\r\n            var uninstallable = updates.Where(x => x.IsUninstallable).ToList();\r\n            if (!uninstallable.Any())\r\n                throw new ArgumentException(\"Selected update is not uninstallable\");\r\n\r\n            var wuaInstaller = wuaSession.CreateUpdateInstaller();\r\n            wuaInstaller.Updates = new UpdateCollectionClass();\r\n            foreach (var update in uninstallable)\r\n                wuaInstaller.Updates.Add(update);\r\n\r\n            Console.WriteLine(\"Uninstalling \" + string.Join(\"; \", uninstallable.Select(x => x.Title)) + \"...\");\r\n            WaitForInstallerBusy(wuaInstaller);\r\n            var result = wuaInstaller.Uninstall();\r\n            WaitForInstallerBusy(wuaInstaller);\r\n\r\n            switch (result.ResultCode)\r\n            {\r\n                case OperationResultCode.orcNotStarted:\r\n                    throw new ArgumentException(\"Selected update is not uninstallable\");\r\n                case OperationResultCode.orcInProgress:\r\n                    break;\r\n                case OperationResultCode.orcSucceeded:\r","sourceCodeStart":12,"sourceCodeEnd":48,"githubUrl":"https://github.com/BCUninstaller/Bulk-Crap-Uninstaller/blob/608321de98e92297377b1eb69029af55c25504a1/source/WinUpdateHelper/UpdateManager.cs#L12-L48","documentation":"ArgumentException thrown after the search when updates were found but none have IsUninstallable==true. Windows Update marks some updates as non-removable (e.g. servicing-stack, defender definitions, mandatory OS components); the tool refuses to uninstall anything it cannot safely remove, so it errors before touching the installer.","triggerScenarios":"The UpdateID resolves to an installed update whose IsUninstallable property is false. The updates collection is non-empty but every member is flagged non-uninstallable.","commonSituations":"Attempting to remove a servicing-stack update, a cumulative update that is pinned, or a definition update that WU does not allow uninstalling. Group/family updates where only the parent matches the ID and it is non-removable. Policy (e.g. MDM/Intune) marking updates permanent.","solutions":["Confirm via 'list' output that IsUninstallable is true for the target update before calling uninstall.","If the update is genuinely non-uninstallable, use DISM or the appropriate OS path (e.g. 'dism /online /Remove-Package') only if you understand the consequences.","Pick a different, uninstallable equivalent update if one exists."],"exampleFix":"// before - assume every listed update is removable\nWinUpdateHelper.exe uninstall <id>\n\n// after - pre-filter on the listed IsUninstallable flag\n// (parse 'list' output, only uninstall where IsUninstallable=True)","handlingStrategy":"validation","validationCode":"var u = SearchUpdate(updateId);\nif (u == null || !u.IsUninstallable) throw new ArgumentException(\"Selected update is not uninstallable\");","typeGuard":"bool IsUninstallable(string updateId)\n{\n    var searcher = new UpdateSessionClass().CreateUpdateSearcher();\n    var r = searcher.Search($\"Type='Software' and IsInstalled=1 and UpdateID='{updateId}' and IsPresent=1\");\n    return r.Updates.OfType<IUpdate>().Any(x => x.IsUninstallable);\n}","tryCatchPattern":null,"preventionTips":["Check the IsUninstallable field in 'list' output before attempting uninstall.","Servicing-stack, definition, and policy-pinned updates are not removable via this tool.","Pick an uninstallable equivalent update if one exists."],"tags":["windows-update","wu","not-uninstallable","wua","uninstall"],"backgroundTag":null,"analyzedSha":"608321de98e92297377b1eb69029af55c25504a1","analyzedAt":"2026-08-13T12:17:35.389Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}