{"record":{"id":"db587bb37b7c460e","repo":"JosefNemec/Playnite","slug":"cannot-start-process-executable-path-is-specified","errorCode":null,"errorMessage":"Cannot start process, executable path is specified.","messagePattern":"Cannot start process, executable path is specified\\.","errorType":"validation","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"source/Playnite/Common/ProcessStarter.cs","lineNumber":100,"sourceCode":"            }\r\n        }\r\n\r\n        public static Process StartProcess(string path, bool asAdmin = false)\r\n        {\r\n            return StartProcess(path, string.Empty, string.Empty, asAdmin);\r\n        }\r\n\r\n        public static Process StartProcess(string path, string arguments, bool asAdmin = false)\r\n        {\r\n            return StartProcess(path, arguments, string.Empty, asAdmin);\r\n        }\r\n\r\n        public static Process StartProcess(string path, string arguments, string workDir, bool asAdmin = false)\r\n        {\r\n            logger.Debug($\"Starting process: {path}, {arguments}, {workDir}, {asAdmin}\");\r\n            if (path.IsNullOrWhiteSpace())\r\n            {\r\n                throw new ArgumentNullException(\"Cannot start process, executable path is specified.\");\r\n            }\r\n\r\n            var startupPath = path;\r\n            if (path.Contains(\"..\"))\r\n            {\r\n                startupPath = Path.GetFullPath(path);\r\n            }\r\n\r\n            var info = new ProcessStartInfo(startupPath)\r\n            {\r\n                Arguments = arguments,\r\n                WorkingDirectory = string.IsNullOrEmpty(workDir) ? (new FileInfo(startupPath)).Directory.FullName : workDir\r\n            };\r\n\r\n            if (asAdmin)\r\n            {\r\n                info.Verb = \"runas\";\r\n            }\r","sourceCodeStart":82,"sourceCodeEnd":118,"githubUrl":"https://github.com/JosefNemec/Playnite/blob/5911f4e964e628aa7a69c2030ab35101afa63067/source/Playnite/Common/ProcessStarter.cs#L82-L118","documentation":"Thrown by ProcessStarter.StartProcess(string,string,bool) overload (which delegates to the workDir variant) when path is null/empty/whitespace. NOTE: it is an ArgumentNullException but the message 'executable path is specified' is a wording bug — it means the path is NOT specified/empty.","triggerScenarios":"Calling StartProcess with a null or empty executable path; a game action whose Path resolved to empty after variable expansion; a plugin launching a program whose install location was not detected.","commonSituations":"Game install moved/uninstalled so the saved executable path is empty; ExpandableVariables expansion produced an empty string; misconfigured custom action with a blank Path field.","solutions":["Validate path is non-whitespace and File.Exists(path) before calling StartProcess.","Resolve and re-expand any Playnite variables in the path first.","Re-detect the game's install location and update the action path."],"exampleFix":"// before\nProcessStarter.StartProcess(action.Path, action.Arguments);\n\n// after — guard empty/missing executable\nif (action.Path.IsNullOrWhiteSpace() || !File.Exists(action.Path))\n{\n    logger.Error($\"Executable missing: '{action.Path}'\");\n    return;\n}\nProcessStarter.StartProcess(action.Path, action.Arguments);","handlingStrategy":"validation","validationCode":"if (path.IsNullOrWhiteSpace() || !File.Exists(path)) throw new FileNotFoundException(path);","typeGuard":"static bool IsRunnablePath(string p) => !p.IsNullOrWhiteSpace() && File.Exists(p);","tryCatchPattern":"try { return ProcessStarter.StartProcess(path, args, workDir); }\ncatch (ArgumentNullException) when (path.IsNullOrWhiteSpace()) { logger.Error($\"empty exe path\"); return null; }","preventionTips":["Expand Playnite variables and verify File.Exists before launching.","Re-detect install locations for games whose path resolved empty.","Guard upstream callers against null action.Path."],"tags":["process","validation","playnite"],"backgroundTag":null,"analyzedSha":"5911f4e964e628aa7a69c2030ab35101afa63067","analyzedAt":"2026-08-13T17:38:25.713Z","schemaVersion":2},"datasetVersion":"2026-08-13T19:17:28.613Z"}