Long Paths
Cheat sheet · https://pcornel.dk/topic.php?topic=2976
Answer
Long paths over 260 characters (MAX_PATH) fail in many Windows apps. Enable LongPathsEnabled by policy or registry for apps that support it, or use the \\?\ prefix and tools like robocopy that handle long paths.
Remember
- LongPathsEnabled helps only applications that declare long-path support.
- The \\?\ prefix bypasses MAX_PATH in many APIs.
- robocopy and PowerShell 7 handle long paths.
First checks
Get-ChildItem <path> -Force— contents including hiddenTest-Path <path>— exists?Resolve-Path <path>— full pathGet-Item <path> | fl *— attributes and timestamps
Verify in this order
path length → MAX_PATH 260 unless long paths enabled and app aware
Where it usually breaks
First mismatch in target identity/version → persistent configuration/source of truth → provider/service/control plane → runtime/effective state → user/workload-visible result → event/log evidence; preserve identity/native error/pre-state before mutation.
Read-only verification commands unless stated otherwise. Confirm syntax for your platform and release. Full reference: https://pcornel.dk/topic.php?topic=2976