{"record":{"id":"d42ace919d84a7d1","repo":"jdx/mise","slug":"cmd-exe-cannot-use-a-unc-path-as-a-working-directo","errorCode":null,"errorMessage":"cmd.exe cannot use a UNC path as a working directory\n\n  working directory: {dir}\n\nIt would start in C:\\Windows instead and run the command there, so mise stops rather than running it somewhere you did not ask for.\n\nUse a shell that accepts UNC paths, either for this task:\n\n  shell = \"pwsh -c\"\n\nor for every task:\n\n  mise settings windows_default_inline_shell_args=\"pwsh -c\"\n\nA file task takes its shell from windows_default_file_shell_args instead.","messagePattern":"cmd\\.exe cannot use a UNC path as a working directory\n\n  working directory: (.+?)\n\nIt would start in C:\\\\Windows instead and run the command there, so mise stops rather than running it somewhere you did not ask for\\.\n\nUse a shell that accepts UNC paths, either for this task:\n\n  shell = \"pwsh -c\"\n\nor for every task:\n\n  mise settings windows_default_inline_shell_args=\"pwsh -c\"\n\nA file task takes its shell from windows_default_file_shell_args instead\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/task/task_executor.rs","lineNumber":1385,"sourceCode":"        let mut inputs = Vec::with_capacity(cache.command_inputs.len());\n        for command in &cache.command_inputs {\n            if command.trim().is_empty() {\n                eyre::bail!(\n                    \"task {} cache command input must not be empty: {command:?}\",\n                    task.name\n                );\n            }\n            let (program, args, cmd_verbatim) =\n                self.get_cmd_program_and_args(command, task, &[])?;\n            // The same refusal as in `exec_program`, and it matters more here: these commands feed\n            // the cache key, so running them from C:\\Windows would hash the wrong directory's\n            // answer. Measured on 2026.8.6 with the project on a UNC share — a `command_inputs`\n            // entry reading a file that exists in the project fails, while the same config on a\n            // local path succeeds. `--dry-run` does not reach here (see the cache branch in\n            // `run_task`), so there is nothing to exempt.\n            #[cfg(windows)]\n            if cmd_shell_cannot_use_dir(&program, &root) {\n                eyre::bail!(\"{}\", unc_working_dir_error(&root));\n            }\n            #[cfg(not(windows))]\n            let _ = cmd_verbatim;\n            let program = program.to_executable();\n            #[cfg(windows)]\n            let program = crate::path::resolve_posix_shell_program_path(&program, &filtered_env)\n                .unwrap_or(program);\n            let env = maybe_convert_env_for_msys_shell(Path::new(&program), &filtered_env);\n            let runner = CmdLineRunner::new(program);\n            #[cfg(windows)]\n            let runner = if cmd_verbatim {\n                args.iter().fold(runner, |runner, arg| runner.raw_arg(arg))\n            } else {\n                runner.args(&args)\n            };\n            #[cfg(not(windows))]\n            let runner = runner.args(&args);\n            let mut runner = runner","sourceCodeStart":1367,"sourceCodeEnd":1403,"githubUrl":"https://github.com/jdx/mise/blob/6f52dcdf99e282ef7a7db68c81301fa4618d0f79/src/task/task_executor.rs#L1367-L1403","documentation":"Error \"cmd.exe cannot use a UNC path as a working directory\n\n  working directory: {dir}\n\nIt would start in C:\\Windows instead and run the command there, so mise stops rather than running it somewhere you did not ask for.\n\nUse a shell that accepts UNC paths, either for this task:\n\n  shell = \"pwsh -c\"\n\nor for every task:\n\n  mise settings windows_default_inline_shell_args=\"pwsh -c\"\n\nA file task takes its shell from windows_default_file_shell_args instead.\" thrown in jdx/mise.","triggerScenarios":"Thrown at src/task/task_executor.rs:1385 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set the task's shell to one that accepts UNC paths, e.g. add `shell = \"pwsh -c\"` to the task.","Or set it globally: `mise settings windows_default_inline_shell_args=\"pwsh -c\"`.","For file tasks, set `windows_default_file_shell_args` instead."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6f52dcdf99e282ef7a7db68c81301fa4618d0f79","analyzedAt":"2026-08-22T10:14:23.840Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}