{"record":{"id":"7e7c1ef1f5ef8e05","repo":"BCUninstaller/Bulk-Crap-Uninstaller","slug":"selected-update-was-not-found","errorCode":null,"errorMessage":"Selected update was not found","messagePattern":"Selected update was not found","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"warning","filePath":"source/WinUpdateHelper/UpdateManager.cs","lineNumber":27,"sourceCode":"using System.Runtime.InteropServices;\r\nusing System.Threading;\r\nusing Klocman;\r\nusing 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","sourceCodeStart":9,"sourceCodeEnd":45,"githubUrl":"https://github.com/BCUninstaller/Bulk-Crap-Uninstaller/blob/608321de98e92297377b1eb69029af55c25504a1/source/WinUpdateHelper/UpdateManager.cs#L9-L45","documentation":"ArgumentException thrown by UpdateManager.UninstallUpdate when the WUA search (Type='Software' and IsInstalled=1 and UpdateID='<id>' and IsPresent=1) returns no IUpdate results. The updateId does not correspond to any installed, present software update on this machine, so there is nothing to uninstall.","triggerScenarios":"Passing an UpdateID that is not installed, was already uninstalled, is a driver (Type!='Software'), is not IsPresent, or simply does not exist. The search criteria are strict: all four conditions must match.","commonSituations":"Stale UpdateID copied from another machine. The update was superseded/removed by Windows since it was listed. ID belongs to a driver or definition update excluded by Type='Software'. IsPresent=0 because the payload is cached but not deployed. Running on a machine where the update was never applicable.","solutions":["Run 'list' on the target machine to confirm the UpdateID is currently installed and present before calling uninstall.","Verify you are using the correct UpdateID + RevisionNumber (list prints both).","If the update is a driver, note the tool only handles Type='Software'.","Re-scan: the update may have been replaced; pick the current equivalent update."],"exampleFix":"// before - blind uninstall with an ID from another host\nWinUpdateHelper.exe uninstall deadbeef-...\n\n// after - look up the live ID first, then uninstall\nWinUpdateHelper.exe list   // copy the real UpdateID\nWinUpdateHelper.exe uninstall <id-from-list>","handlingStrategy":"validation","validationCode":"// Use the 'list' command to confirm the ID is installed+present before uninstalling.\nvar installed = ListInstalledUpdateIds();\nif (!installed.Contains(updateId)) throw new ArgumentException(\"Selected update was not found\");","typeGuard":"bool UpdateIsInstalledAndPresent(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.Count > 0;\n}","tryCatchPattern":null,"preventionTips":["Run 'list' on the same machine immediately before uninstalling to confirm the ID.","Use the exact UpdateID + RevisionNumber returned by 'list'.","Remember the tool only handles Type='Software' updates."],"tags":["windows-update","wu","update-not-found","wua","uninstall"],"backgroundTag":null,"analyzedSha":"608321de98e92297377b1eb69029af55c25504a1","analyzedAt":"2026-08-13T12:17:35.389Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}