{"record":{"id":"efc839e7abef6970","repo":"BCUninstaller/Bulk-Crap-Uninstaller","slug":"file-not-found","errorCode":null,"errorMessage":"File not found.","messagePattern":"File not found\\.","errorType":"exception","errorClass":"IOException","httpStatus":null,"severity":"error","filePath":"source/BulkCrapUninstaller/Functions/AppUninstaller.cs","lineNumber":656,"sourceCode":"            Monitor.Exit(_uninstallLock);\r\n        }\r\n\r\n        private static void RunExternalCommands(string commands, LoadingDialogInterface controller)\r\n        {\r\n            var lines = commands.SplitNewlines(StringSplitOptions.RemoveEmptyEntries);\r\n            controller.SetMaximum(lines.Length);\r\n\r\n            for (var i = 0; i < lines.Length; i++)\r\n            {\r\n                controller.SetProgress(i);\r\n\r\n                var line = lines[i];\r\n                try\r\n                {\r\n                    var filename = ProcessTools.SeparateArgsFromCommand(line);\r\n                    filename.FileName = Path.GetFullPath(filename.FileName);\r\n                    if (!File.Exists(filename.FileName))\r\n                        throw new IOException(Localisable.Error_FileNotFound);\r\n                    filename.ToProcessStartInfo().StartAndWait();\r\n                }\r\n                catch (Exception ex)\r\n                {\r\n                    MessageBox.Show(string.Format(Localisable.MessageBoxes_ExternalCommandFailed_Message, line)\r\n                                    + Localisable.MessageBoxes_Error_details + ex.Message,\r\n                        Localisable.MessageBoxes_ExternalCommandFailed_Title,\r\n                        MessageBoxButtons.OK, MessageBoxIcon.Error);\r\n                }\r\n            }\r\n        }\r\n\r\n        /// <summary>\r\n        ///     Attempt to get the lock and display error popup if the process fails.\r\n        /// </summary>\r\n        /// <returns>True if lock was succesfully acquired, otherwise false.</returns>\r\n        private bool TryGetUninstallLock()\r\n        {\r","sourceCodeStart":638,"sourceCodeEnd":674,"githubUrl":"https://github.com/BCUninstaller/Bulk-Crap-Uninstaller/blob/608321de98e92297377b1eb69029af55c25504a1/source/BulkCrapUninstaller/Functions/AppUninstaller.cs#L638-L674","documentation":"RunExternalCommands splits a user-supplied block of custom commands into lines and, for each line, resolves the executable path with Path.GetFullPath. If the executable does not exist on disk after resolution, this IOException (Error_FileNotFound) is thrown and shown in a message box naming the failing command.","triggerScenarios":"A custom external command references an executable that is misspelled, relative to an unexpected working directory, or no longer installed; environment variables in the path were not expanded.","commonSituations":"Typo in the command path; the tool was moved or uninstalled; a relative path resolved against the wrong cwd; %VAR% not expanded.","solutions":["Correct the path in the saved custom command.","Use an absolute path to the executable.","Ensure the referenced tool is actually installed on this machine.","Expand any environment variables before saving the command."],"exampleFix":"// before\nmytool.exe /clean\n// after\nC:\\Tools\\mytool.exe /clean","handlingStrategy":"validation","validationCode":"if (!File.Exists(Path.GetFullPath(cmd.FileName)))\n    /* report missing executable before starting */","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use absolute paths for external commands.","Expand environment variables before saving commands.","Verify referenced tools are installed before running."],"tags":["external-command","filesystem","user-input"],"backgroundTag":null,"analyzedSha":"608321de98e92297377b1eb69029af55c25504a1","analyzedAt":"2026-08-13T12:17:35.389Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}