sodcalculator

10 Tech How-To

Fix Path Too Long Error While Extracting on Windows

Guide 10-54111 · Updated · Step by step

The “Path Too Long” error during extraction on Windows happens when file paths exceed the 260-character limit (MAX_PATH). To fix it, enable the long path support in Windows 10/11 settings, use a modern archiver like 7-Zip or NanaZip, or extract to a shorter root folder like C:\temp.

Why Windows Has a 260-Character Path Limit

Windows has historically limited full file paths (drive letter, folders, file name, and extension) to 260 characters, a legacy from older NTFS and Win32 API design. This limit applies to the entire path string, not just the file name. When you extract an archive, the combined path of every file inside it must stay under this cap, otherwise the extraction fails with errors like “The specified path, file name, or both are too long.”

Modern versions of Windows (10 and 11) can handle paths up to 32,767 characters, but this capability must be explicitly enabled in the system registry or via Group Policy. Even then, not all applications respect the new limit, so the problem often persists with older software.

How to Enable Long Path Support in Windows 10/11

The most direct fix is to turn on the long path support feature built into the OS. Here are the steps:

  1. Press Win + R, type gpedit.msc (Group Policy Editor) and press Enter. If you have Windows Home, skip to the registry method below.
  2. Navigate to Computer Configuration > Administrative Templates > System > Filesystem.
  3. Double-click Enable Win32 long paths.
  4. Select Enabled, click OK, then restart your computer.

For Windows Home (which lacks gpedit), use the Registry Editor:

  1. Press Win + R, type regedit and press Enter.
  2. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem.
  3. Find LongPathsEnabled (if it doesn’t exist, right-click > New > DWORD (32-bit) Value and name it).
  4. Set its value to 1 and click OK.
  5. Reboot your PC.

Use a Modern Archiver That Handles Long Paths

Even with the system setting enabled, some older archivers (like the built-in Windows Explorer ZIP handler or WinRAR versions before 5.60) still fail. Use a tool that explicitly supports long paths:

  • 7-Zip (free, open source) – supports long paths since version 15.06.
  • NanaZip – a modern fork of 7-Zip with better Windows integration.
  • WinRAR – version 5.60 and later handles long paths when the system setting is on.

When extracting, right-click the archive and select Extract Here or Extract to [folder] from the context menu. Avoid using the built-in Windows Explorer extraction, as it often ignores the long path setting.

Shorten the Extraction Path

If enabling long paths isn’t possible (e.g., on a work computer without admin rights), the simplest workaround is to extract to a short, shallow folder. For example:

  • Extract directly to C:\temp instead of C:\Users\YourName\Downloads\Project Files\Final Version.
  • Rename the archive to something short like a.zip before extracting.
  • After extraction, move the files to your desired location – the error only occurs during extraction, not when moving within the same drive.

Common Causes and Misconceptions

Many users think the error is about file names being too long, but it’s the full path that matters. For example, a file named report_final_v2_updated.docx is fine, but if it’s nested inside several folders, the path can easily exceed 260 characters. Another misconception is that the error only happens with ZIP files – it can occur with any archive format (RAR, 7z, TAR) and even with regular file operations.

Another common cause is extracting archives that were created on Linux or macOS, where paths can be longer. These archives often contain deeply nested folder structures that exceed the Windows limit.

Alternative: Use the Command Line with \\?\ Prefix

If you’re comfortable with the command prompt, you can bypass the limit by using the extended-length path prefix \\?\. For example:

robocopy C:\source C:\destination /E

This command copies all files including those with long paths, because robocopy natively supports long paths. To extract a ZIP, you can use PowerShell with the System.IO.Compression.ZipFile class, which also supports long paths when the system setting is enabled.

Frequently Asked Questions

Why does the error still appear after I enabled long paths?

Enabling the system setting only affects applications that are compiled to support it. Older or poorly coded software ignores the setting. Also, the setting requires a restart to take effect. If you’re using Windows Explorer to extract, try a third-party archiver instead.

Can I delete files that have too-long paths?

Yes, you can use the \\?\ prefix in Command Prompt to delete them. For example: del \\?\C:\very\long\path\file.txt. Alternatively, use a file manager like 7-Zip that can browse and delete such files.

Does this error affect OneDrive or cloud sync?

Yes, cloud sync services have their own path limits and may fail to sync files with long paths. The same fixes apply – enable long paths on your system, and avoid deep folder structures.

Is the 260-character limit still a problem on Windows 11?

Windows 11 still has the 260-character limit by default for compatibility, but the long path support setting is available just like in Windows 10. You need to enable it manually.

What if I don’t have admin rights to change the registry?

You can still extract to a short path like C:\temp or use a portable archiver that supports long paths without needing the system setting (e.g., 7-Zip portable).

Can I compress files back to avoid the error?

Yes, if you create a ZIP file with a modern archiver, it will store relative paths. When extracting, choose a short destination to avoid hitting the limit.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →