{"record":{"id":"b578ad0556d85593","repo":"BCUninstaller/Bulk-Crap-Uninstaller","slug":"ending-quotation-mark-is-missing","errorCode":null,"errorMessage":"Ending quotation mark is missing.","messagePattern":"Ending quotation mark is missing\\.","errorType":"exception","errorClass":"FormatException","httpStatus":null,"severity":"error","filePath":"source/KlocTools/Tools/ProcessTools.cs","lineNumber":181,"sourceCode":"                            return new ProcessStartCommand(fullCommand.Substring(0, rootSpace).TrimEnd(),\n                                fullCommand.Substring(rootSpace));\n                        }\n                    }\n                }\n            }\n\n            // Check if the path is contained inside of quotation marks.\n            // Assume that the quotation mark must come before the dot. Otherwise, it is likely that the arguments use quotations.\n            var pathEnd = fullCommand.IndexOf('\"', 0, firstDot);\n            if (pathEnd >= 0)\n            {\n                // If yes, find the closing quotation mark and set its index as path end\n                pathEnd = fullCommand.IndexOf('\"', pathEnd + 1);\n\n                if (pathEnd < 0)\n                {\n                    // If no ending quote has been found, explode gracefully.\n                    throw new FormatException(Localisation.Error_SeparateArgsFromCommand_MissingQuotationMark);\n                }\n                pathEnd += 1; //?\n            }\n\n            // If quotation marks were missing, check for any invalid characters after last dot\n            // in case of eg: c:\\test.dir thing\\filename.exe?0 used to get icons\n            if (pathEnd < 0)\n            {\n                var endIndex = 0;\n                while (true)\n                {\n                    var dot = fullCommand.IndexOf('.', endIndex);\n                    if (dot < 0)\n                        break;\n\n                    var filenameBreaker = fullCommand.IndexOfAny(SeparateArgsFromCommandInvalidChars, dot);\n                    var space = fullCommand.IndexOf(' ', dot);\n                    if (filenameBreaker < 0)","sourceCodeStart":163,"sourceCodeEnd":199,"githubUrl":"https://github.com/BCUninstaller/Bulk-Crap-Uninstaller/blob/608321de98e92297377b1eb69029af55c25504a1/source/KlocTools/Tools/ProcessTools.cs#L163-L199","documentation":"Thrown by ProcessTools.SeparateArgsFromCommand when the command string contains an opening quotation mark (found before the first dot) but no matching closing quotation mark. pathEnd = IndexOf('\"', pathEnd+1) returns -1, so the parser cannot determine where the executable path ends and raises FormatException(Localisation.Error_SeparateArgsFromCommand_MissingQuotationMark) = \"Ending quotation mark is missing.\".","triggerScenarios":"Input like \"C:\\Program Files\\App app.exe -arg (opening quote, no close) or a command where the opening quote is actually inside arguments after the dot (the heuristic only treats a quote before the first dot as a path quote).","commonSituations":"Hand-edited command strings, copy-paste from browsers that drop trailing quotes, registry Run entries with malformed quoting, or shell wrapping that adds one quote.","solutions":["Balance the quotes in the input string before parsing (ensure an even number of '\"').","Normalise the command to a fully-quoted path: \"C:\\Path\\App.exe\" args.","Validate quote pairing at the UI/config layer and reject or self-heal odd counts."],"exampleFix":"// before\nvar c = ProcessTools.SeparateArgsFromCommand(@\"\"\"C:\\My App\\app.exe -x\"); // missing close\n\n// after\nvar c = ProcessTools.SeparateArgsFromCommand(@\"\"\"C:\\My App\\app.exe\" -x\");","handlingStrategy":"validation","validationCode":"var quoteCount = fullCommand.Count(c => c == '\"');\nif (quoteCount % 2 != 0)\n    throw new ArgumentException(\"Command has unbalanced quotes\");\nvar cmd = ProcessTools.SeparateArgsFromCommand(fullCommand);","typeGuard":"static bool HasBalancedQuotes(string s) => s.Count(c => c == '\"') % 2 == 0;","tryCatchPattern":"try { var c = ProcessTools.SeparateArgsFromCommand(cmd); }\ncatch (FormatException ex) when (ex.Message.Contains(\"quotation\"))\n{ /* prompt user to fix quoting */ }","preventionTips":["Normalise stored commands to fully-quoted executable paths.","Validate quote pairing before persisting user-entered commands.","Watch for browser/editor copy-paste that drops a trailing quote."],"tags":["parsing","command-line","quoting","csharp","kloctools"],"backgroundTag":null,"analyzedSha":"608321de98e92297377b1eb69029af55c25504a1","analyzedAt":"2026-08-13T12:17:35.389Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}