{"record":{"id":"c92ae741e2f7ea1e","repo":"BCUninstaller/Bulk-Crap-Uninstaller","slug":"the-system-cannot-find-the-file-specified-indicat","errorCode":null,"errorMessage":"The system cannot find the file specified. Indicates that the file can not be found in specified location.","messagePattern":"The system cannot find the file specified\\. Indicates that the file can not be found in specified location\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"source/UninstallTools/Uninstaller/BulkUninstallEntry.cs","lineNumber":437,"sourceCode":"                                     exitVar == 1)\r\n                            {\r\n                                // 1 - Installation aborted by user (cancel button)\r\n                                _skipLevel = SkipCurrentLevel.Skip;\r\n                            }\r\n                            else if (exitVar == -1073741510)\r\n                            {\r\n                                /* 3221225786 / 0xC000013A / -1073741510 \r\n                                    The application terminated as a result of a CTRL+C. \r\n                                    Indicates that the application has been terminated either by user's \r\n                                    keyboard input CTRL+C or CTRL+Break or closing command prompt window. */\r\n                                _skipLevel = SkipCurrentLevel.Terminate;\r\n                            }\r\n                            else\r\n                            {\r\n                                switch (exitVar)\r\n                                {\r\n                                    case 2:\r\n                                        throw new Exception(\"The system cannot find the file specified. Indicates that the file can not be found in specified location.\");\r\n                                    case 3:\r\n                                        throw new Exception(\"The system cannot find the path specified. Indicates that the specified path can not be found.\");\r\n                                    case 5:\r\n                                        throw new Exception(\"Access is denied. Indicates that user has no access right to specified resource.\");\r\n                                    case 9009:\r\n                                        throw new Exception(\"Program is not recognized as an internal or external command, operable program or batch file.\");\r\n                                    case -2147024846:\r\n                                        throw new Exception(\"0x80070032 - This app is part of Windows and cannot be uninstalled on a per-user basis.\");\r\n\r\n                                    default:\r\n                                        if (options.RetryFailedQuiet || (UninstallerEntry.UninstallerKind == UninstallerType.Nsis && !options.PreferQuiet))\r\n                                            retry = true;\r\n                                        throw new IOException(Localisation.UninstallError_UninstallerReturnedCode + exitVar);\r\n                                }\r\n                            }\r\n                        }\r\n                    }\r\n                }\r","sourceCodeStart":419,"sourceCodeEnd":455,"githubUrl":"https://github.com/BCUninstaller/Bulk-Crap-Uninstaller/blob/608321de98e92297377b1eb69029af55c25504a1/source/UninstallTools/Uninstaller/BulkUninstallEntry.cs#L419-L455","documentation":"In the exit-code switch, exitVar == 2 maps to a thrown Exception with the Win32 ERROR_FILE_NOT_FOUND description. The spawned uninstaller/launcher process exited with code 2, meaning the executable or a file it needs could not be found at the specified location.","triggerScenarios":"Process.Start launched a command line whose target file (or first token) does not exist, and the OS returned exit code 2. The UninstallString pointed to a binary that was already deleted, moved, or referenced by a stale path.","commonSituations":"The uninstaller binary was removed by a previous cleanup; the path uses an environment variable that is unset in the spawned context; the entry's UninstallString was scraped from registry with an unquoted path containing spaces that got truncated.","solutions":["Validate the target path with File.Exists before launching; if missing, fall back to the registry 'Modify' path or mark the entry for manual removal.","Quote/escape the UninstallString correctly (split executable from args) — see UpdateNsisStartInfo for the pattern.","Resolve environment variables and short (8.3) names in the path before launching."],"exampleFix":"// before\nvar p = Process.Start(startInfo);\n\n// after\nvar exe = ExtractExecutablePath(startInfo.FileName);\nif (!File.Exists(exe))\n    throw new InvalidOperationException($\"Uninstaller binary not found: {exe}\");\nvar p = Process.Start(startInfo);","handlingStrategy":"validation","validationCode":"var exe = ExtractExecutablePath(entry.UninstallString);\nif (!File.Exists(exe))\n{\n    entry.MarkManualOnly($\"Uninstaller binary not found: {exe}\");\n    return;\n}\nmanager.RunUninstaller(entry, options);","typeGuard":"null","tryCatchPattern":"null","preventionTips":["Resolve the executable token to an absolute path before launching.","Quote paths with spaces to avoid truncation when scraping UninstallString.","Fall back to the registry 'Modify' path when the primary uninstaller is missing."],"tags":["uninstaller","process-exit-code","file-not-found","exit-code-2","windows"],"backgroundTag":null,"analyzedSha":"608321de98e92297377b1eb69029af55c25504a1","analyzedAt":"2026-08-13T12:17:35.389Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}