{"record":{"id":"3c62e15df9e2a7de","repo":"jdx/mise","slug":"err-creating-directory-symlinks-on-windows-may","errorCode":null,"errorMessage":"{err}. Creating directory symlinks on Windows may require administrator privileges or Developer Mode","messagePattern":"(.+?)\\. Creating directory symlinks on Windows may require administrator privileges or Developer Mode","errorType":"exception","errorClass":"std::io::Error","httpStatus":null,"severity":"error","filePath":"src/file.rs","lineNumber":1067,"sourceCode":"}\n\n#[cfg(windows)]\npub(crate) fn is_unc_path(path: &Path) -> bool {\n    matches!(\n        path.components().next(),\n        Some(std::path::Component::Prefix(prefix))\n            if matches!(\n                prefix.kind(),\n                std::path::Prefix::UNC(..) | std::path::Prefix::VerbatimUNC(..)\n            )\n    )\n}\n\n#[cfg(windows)]\nfn create_windows_unc_symlink(target: &Path, link: &Path) -> std::io::Result<()> {\n    std::os::windows::fs::symlink_dir(target, link).map_err(|err| {\n        if err.kind() == std::io::ErrorKind::PermissionDenied {\n            std::io::Error::new(\n                err.kind(),\n                format!(\n                    \"{err}. Creating directory symlinks on Windows may require administrator privileges or Developer Mode\"\n                ),\n            )\n        } else {\n            err\n        }\n    })\n}\n\n#[cfg(windows)]\nfn create_windows_dir_link(target: &Path, link: &Path) -> std::io::Result<()> {\n    if is_unc_path(target) {\n        create_windows_unc_symlink(target, link)\n    } else {\n        junction::create(target, link)\n    }","sourceCodeStart":1049,"sourceCodeEnd":1085,"githubUrl":"https://github.com/jdx/mise/blob/533346cc374382b41ec5ff70536252b2e96e725c/src/file.rs#L1049-L1085","documentation":"On Windows, `create_windows_unc_symlink` calls `std::os::windows::fs::symlink_dir`. When that fails with `PermissionDenied`, mise enriches the io error with guidance: creating directory symlinks on Windows requires either administrator privileges or Developer Mode to be enabled. The enriched error is then propagated by `create_windows_dir_link`.","triggerScenarios":"Calling file-link creation (e.g. symlinking an installed tool into a bin dir) on Windows without elevated rights or Developer Mode, so `symlink_dir(target, link)` returns `ErrorKind::PermissionDenied`.","commonSituations":"Regular (non-admin) user without Developer Mode running `mise install` for a tool that uses directory symlinks; restricted corporate laptop policy; running in a service account without the SeCreateSymbolicLinkPrivilege.","solutions":["Enable Developer Mode: Settings → Update & Security → For developers → Developer Mode (allows symlink creation without elevation).","Re-run the mise command from an elevated (Administrator) terminal.","Grant the account the SeCreateSymbolicLinkPrivilege via secpol/Group Policy, or use a mise setting that avoids symlinks (e.g. copy/shim strategy)."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Windows: check privilege before linking\nlet test_link = std::env::temp_dir().join(\"mise-symlink-probe\");\nlet _ = std::fs::remove_file(&test_link);\nif std::os::windows::fs::symlink_dir(\"C:\\\\Windows\", &test_link).is_err() {\n    eprintln!(\"symlink creation unavailable: enable Developer Mode or run elevated\");\n}","typeGuard":null,"tryCatchPattern":"match create_windows_dir_link(target, link) {\n    Err(e) if e.kind() == std::io::ErrorKind::PermissionDenied => {\n        eprintln!(\"enable Developer Mode or run as Administrator, then retry\");\n    }\n    other => other?,\n}","preventionTips":["Enable Windows Developer Mode before using tools that symlink directories.","Run installation commands from an elevated shell when Developer Mode is off.","Prefer mise settings that avoid symlinks on restricted machines."],"tags":["windows","symlink","permissions","filesystem"],"backgroundTag":"permission-denied","analyzedSha":"533346cc374382b41ec5ff70536252b2e96e725c","analyzedAt":"2026-09-17T13:35:38.149Z","contentChangedAt":"2026-09-17T13:35:38.149Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}