Fix Long Path Errors When Copying Deeply Nested Folders on Windows 11
🔍 WiseChecker

Fix Long Path Errors When Copying Deeply Nested Folders on Windows 11

Quick fix: Open Group Policy Editor (gpedit.msc) → Computer Configuration → Administrative Templates → System → Filesystem, and enable Enable Win32 long paths. On Home edition, set the registry DWORD LongPathsEnabled to 1 at HKLM\SYSTEM\CurrentControlSet\Control\FileSystem.

You try to copy a deeply nested folder structure and Windows says: The file name(s) would be too long for the destination folder. Even File Explorer can’t open the file. Some apps work, others don’t. The cause is the 260-character path limit Windows has carried since the early days. Windows 10 1607+ supports long paths but requires both a system-level flag and per-app awareness.

Symptom: File copy or rename fails with “The file name(s) would be too long” or “Path too long.” Affects deeply nested folder trees (often from node_modules, sync clients, or backups of other systems).
Affects: Windows 11 (and Windows 10 1607+) when the combined path exceeds 260 characters.
Fix time: ~5 minutes.

ADVERTISEMENT

What causes this

Windows’ Win32 API historically limited paths to MAX_PATH = 260 characters (drive letter + colon + backslash + folder/file names + null terminator). The NTFS filesystem itself supports paths up to 32,767 characters, but Win32 API truncates anything longer at the API level. Windows 10 1607 introduced the long path aware manifest flag — apps can opt in to receive paths up to 32,767 chars. The OS-level switch enables this support; per-app support requires the app to also opt in.

File Explorer on Windows 11 supports long paths by default once the OS switch is on. Older apps don’t — you may need to use copy alternatives like robocopy or 7-Zip for those.

Method 1: Enable long path support via Group Policy (Pro/Enterprise)

The standard fix on Pro and higher editions.

  1. Press Win + R, type gpedit.msc, press Enter.
  2. Navigate to Computer Configuration → Administrative Templates → System → Filesystem.
  3. In the right pane, find Enable Win32 long paths.
  4. Double-click it. Set to Enabled. Click Apply → OK.
  5. Run gpupdate /force from an elevated Command Prompt.
  6. Reboot for the change to fully apply.
  7. Try the failing copy or rename — File Explorer and modern apps should now handle paths up to 32,767 characters.

This is the cleanest fix for Pro users.

ADVERTISEMENT

Method 2: Enable via registry (Home edition friendly)

Equivalent change for Windows 11 Home, where Group Policy Editor isn’t available.

  1. Press Win + R, type regedit, press Enter.
  2. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem.
  3. Find the LongPathsEnabled DWORD. If it doesn’t exist, create it.
  4. Set value to 1.
  5. Close Registry Editor.
  6. Reboot.
  7. Long path support is now enabled system-wide.

Works on every Windows 11 edition. The registry value is the underlying mechanism Group Policy uses.

Method 3: Use robocopy or 7-Zip for the immediate copy

When you need to copy a long-path folder right now and can’t reboot, or when an old app refuses to handle long paths even with the OS flag enabled.

  1. Open Terminal (Admin).
  2. Use robocopy for the copy operation:
    robocopy "C:\source\deep\nested\folder" "D:\destination" /E /COPY:DAT /R:3 /W:5

    The flags: /E copies subdirectories including empty ones; /COPY:DAT preserves Data, Attributes, Timestamps; /R:3 retries 3 times; /W:5 waits 5 seconds between retries.

  3. Robocopy handles paths up to ~32,000 characters internally. The destination must be on a filesystem that also supports long paths (NTFS does; FAT32 doesn’t).
  4. Alternative: install 7-Zip. Use it to compress the long-path folder into a .7z file. The archive can be safely copied; extract on a destination with long path support enabled.
  5. For interactive long-path file manipulation, install Far Manager or Total Commander — both handle long paths natively without requiring the OS flag.

These tools work in advance of the OS-level fix or alongside it.

How to verify the fix worked

  • Create a test path: open File Explorer, make nested folders to exceed 260 characters total.
  • Try copying a file into the deepest folder. Copy should succeed.
  • Open the long-path file in Notepad. File opens and saves correctly.
  • Run Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name LongPathsEnabled in PowerShell. Value should be 1.

If none of these work

If long paths still fail after enabling the OS flag, three causes apply. App not long-path aware: the specific app you’re using doesn’t declare itself as long-path aware in its manifest. There’s no fix from your side — the app needs an update from its vendor. Workaround: copy or rename via File Explorer (which is long-path aware) or via robocopy. Destination filesystem limit: copying to a FAT32 USB drive caps paths at 260 chars regardless of OS flag. Reformat the drive to exFAT or NTFS, which both support long paths. Path traversal limit: the \\?\ prefix on full paths bypasses normalization but only works with explicit calls — most GUI apps don’t use it. Try copy "\\?\C:\very\long\path\file.txt" "\\?\D:\destination" from Terminal to verify the underlying NTFS supports the operation.

Bottom line: Windows 11 supports paths up to 32,767 chars — but the support is opt-in. Flip the registry or Group Policy switch, reboot, and File Explorer plus modern apps stop hitting the 260-char wall.

ADVERTISEMENT