jdx/mise · error
cmd.exe cannot use a UNC path as a working directory work
Error message
cmd.exe cannot use a UNC path as a working directory
working directory: {dir}
It would start in C:\Windows instead and run the command there, so mise stops rather than running it somewhere you did not ask for.
Use a shell that accepts UNC paths, either for this task:
shell = "pwsh -c"
or for every task:
mise settings windows_default_inline_shell_args="pwsh -c"
A file task takes its shell from windows_default_file_shell_args instead. What it means
Error "cmd.exe cannot use a UNC path as a working directory working directory: {dir} It would start in C:\Windows instead and run the command there, so mise stops rather than running it somewhere you did not ask for. Use a shell that accepts UNC paths, either for this task: shell = "pwsh -c" or for every task: mise settings windows_default_inline_shell_args="pwsh -c" A file task takes its shell from windows_default_file_shell_args instead." thrown in jdx/mise.
Source
Thrown at src/task/task_executor.rs:1385
let mut inputs = Vec::with_capacity(cache.command_inputs.len());
for command in &cache.command_inputs {
if command.trim().is_empty() {
eyre::bail!(
"task {} cache command input must not be empty: {command:?}",
task.name
);
}
let (program, args, cmd_verbatim) =
self.get_cmd_program_and_args(command, task, &[])?;
// The same refusal as in `exec_program`, and it matters more here: these commands feed
// the cache key, so running them from C:\Windows would hash the wrong directory's
// answer. Measured on 2026.8.6 with the project on a UNC share — a `command_inputs`
// entry reading a file that exists in the project fails, while the same config on a
// local path succeeds. `--dry-run` does not reach here (see the cache branch in
// `run_task`), so there is nothing to exempt.
#[cfg(windows)]
if cmd_shell_cannot_use_dir(&program, &root) {
eyre::bail!("{}", unc_working_dir_error(&root));
}
#[cfg(not(windows))]
let _ = cmd_verbatim;
let program = program.to_executable();
#[cfg(windows)]
let program = crate::path::resolve_posix_shell_program_path(&program, &filtered_env)
.unwrap_or(program);
let env = maybe_convert_env_for_msys_shell(Path::new(&program), &filtered_env);
let runner = CmdLineRunner::new(program);
#[cfg(windows)]
let runner = if cmd_verbatim {
args.iter().fold(runner, |runner, arg| runner.raw_arg(arg))
} else {
runner.args(&args)
};
#[cfg(not(windows))]
let runner = runner.args(&args);
let mut runner = runnerView on GitHub (pinned to 6f52dcdf99)
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.
When it happens
Trigger: Thrown at src/task/task_executor.rs:1385 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of jdx/mise@6f52dcdf99 (2026-08-22).
Data as JSON: /api/errors/d42ace919d84a7d1.
Report an issue: GitHub.