Enable Long Paths on Windows (Fix 'Path Too Long')
Lift the 260-character path limit by setting LongPathsEnabled=1 in the registry, for deep node_modules or archive trees.
01Command
$ reg add "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f02What it does
Legacy Win32 APIs cap paths at 260 characters (MAX_PATH), which is why extracting an archive or deleting node_modules can fail with 'path too long'. Setting LongPathsEnabled to 1 lets long-path-aware applications use paths up to about 32,000 characters; the app must opt in (git config core.longpaths true is git's own switch). Shortcuts like robocopy and the \\?\ prefix work around the limit per-command without touching the registry.
03Risk
04Undo
$ reg add "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 0 /f05Sources
- Maximum File Path LimitationEvidence: Documents the 260-character MAX_PATH limit and the LongPathsEnabled registry key that lifts it for long-path-aware apps.
Last verified: 2026-09-18 · Category: Files & Folders
06Related solutions
Diagnose NTFS file system errors and bad sectors on any volume — including the system drive while Windows is running — before committing to a repair.
Robocopy is Windows' built-in robust file copier: use /MIR to keep a destination folder as an exact one-way mirror of a source, resumable and restartable.
Two-step command sequence that makes you the owner of a locked file tree and grants yourself full control — the standard fix for 'Access is denied' on old profiles and OS reinstall leftovers.