{"record":{"id":"cc351adcd0246ef0","repo":"BCUninstaller/Bulk-Crap-Uninstaller","slug":"multiple-updateids-specified","errorCode":null,"errorMessage":"Multiple UpdateIDs specified","messagePattern":"Multiple UpdateIDs specified","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"warning","filePath":"source/WinUpdateHelper/Program.cs","lineNumber":92,"sourceCode":"                switch (arg.ToLowerInvariant())\r\n                {\r\n                    case @\"u\":\r\n                    case @\"uninstall\":\r\n                        if (_queryType != QueryType.None) throw new ArgumentException(@\"Multiple commands specified\");\r\n                        _queryType = QueryType.Uninstall;\r\n                        break;\r\n\r\n                    case @\"l\":\r\n                    case @\"list\":\r\n                        if (_queryType != QueryType.None) throw new ArgumentException(@\"Multiple commands specified\");\r\n                        _queryType = QueryType.List;\r\n                        break;\r\n\r\n                    default:\r\n                        if (_queryType != QueryType.Uninstall)\r\n                            throw new ArgumentException($@\"Unknown argument: {arg}\");\r\n                        if (_updateId != null)\r\n                            throw new ArgumentException(@\"Multiple UpdateIDs specified\");\r\n                        _updateId = arg;\r\n                        break;\r\n                }\r\n            }\r\n\r\n            if (_queryType == QueryType.None)\r\n                throw new ArgumentException(@\"No commands specified\");\r\n\r\n            if (_queryType == QueryType.Uninstall && _updateId == null)\r\n                throw new ArgumentException(@\"No UpdateID specified\");\r\n        }\r\n\r\n        private enum QueryType\r\n        {\r\n            None,\r\n            Uninstall,\r\n            List\r\n        }\r","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/BCUninstaller/Bulk-Crap-Uninstaller/blob/608321de98e92297377b1eb69029af55c25504a1/source/WinUpdateHelper/Program.cs#L74-L110","documentation":"ArgumentException thrown in the default case when a token is being treated as an UpdateID (i.e. _queryType is Uninstall) but _updateId is already non-null. The uninstall command accepts exactly one UpdateID; a second positional token after the command is rejected.","triggerScenarios":"Invoking 'uninstall <id1> <id2>' where two ID tokens follow the command. A stray trailing argument after the real UpdateID.","commonSituations":"Caller script passes a list of IDs assuming batch uninstall is supported (it is not). A copy-paste duplicate. An extra quoted segment parsed as a separate token.","solutions":["Pass exactly one UpdateID per invocation.","For batch removal, invoke the helper once per ID in a loop rather than one call with many IDs.","Trim/quote arguments in the wrapper so a single ID is not split into two tokens."],"exampleFix":"// before\nWinUpdateHelper.exe uninstall id1 id2\n// after\nforeach ($id in $ids) { WinUpdateHelper.exe uninstall $id }","handlingStrategy":"validation","validationCode":"var positional = args.SkipWhile(a => a.ToLowerInvariant() != \"u\" && a.ToLowerInvariant() != \"uninstall\").Skip(1);\nif (positional.Count() > 1) throw new ArgumentException(\"Multiple UpdateIDs specified\");","typeGuard":"bool HasSingleUpdateId(IList<string> args)\n{\n    var cmdIdx = Enumerable.Range(0, args.Count)\n        .FirstOrDefault(i => new[]{\"u\",\"uninstall\"}.Contains(args[i].ToLowerInvariant()));\n    return args.Skip(cmdIdx + 1).Count() <= 1;\n}","tryCatchPattern":null,"preventionTips":["Pass at most one UpdateID per uninstall invocation.","Loop over IDs in a wrapper instead of batching into one call.","Quote IDs so a single value is not split into multiple tokens."],"tags":["cli","argument-validation","windows-update","wu"],"backgroundTag":null,"analyzedSha":"608321de98e92297377b1eb69029af55c25504a1","analyzedAt":"2026-08-13T12:17:35.389Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}