Skip to main content

File Path Too Long: Enabling Long Paths and Other Workarounds

Media File Path Too Long Enabling Long Paths and Other Workarounds

You try to copy, move, rename, extract or delete a file in Windows 11, only to receive an error such as:

  • “The file name would be too long for the destination folder.”
  • “The source file name is larger than is supported by the file system.”
  • “The path is too long.”
  • “Error 0x80010135: Path too long.”
  • “The specified path, file name, or both are too long.”

The file name itself may look perfectly reasonable. The real problem is usually the complete path Windows must follow to reach it.

For example:

C:\Users\Carl\OneDrive - Company Name\Documents\Customers\North Region\Current Projects\Office Refurbishment\Technical Documentation\Final Approved Versions\Network Infrastructure\Switch Configuration\Configuration Backup.txt

Every folder name, separator, drive letter and character in the file name contributes to the total path length.

Windows 11 can support paths longer than the traditional 260-character limit, but enabling the relevant setting does not guarantee that every application will support them. File Explorer, older software, ZIP utilities, Microsoft 365 applications, cloud-sync platforms and line-of-business programs may each behave differently.

The most reliable solution is often a combination of enabling long-path support and simplifying the folder structure.

Why Does Windows Have a Path-Length Limit?

Traditional Windows applications were designed around a limit known as MAX_PATH.

For many Win32 applications, the conventional maximum path length is 260 characters. That total includes the drive letter, colon, backslashes, folder names, file name and an invisible terminating character used internally by Windows.

Modern Windows versions can work with much longer paths. Microsoft states that many Unicode Windows file functions can support extended paths of approximately 32,767 characters. However, the operating system setting must allow long paths and the application must be specifically designed to use them. (Microsoft Learn⁠)

This distinction is important:

Enabling long paths in Windows does not force every application to understand long paths.

An older application may continue to enforce the 260-character limit because it was built around the original Windows behaviour.

What Makes a File Path Too Long?

Long-path problems are rarely caused by one unusually long file name. They are normally created by several layers of descriptive folders.

A business might organise a file like this:

Customers

└── Customer Name

    └── Financial Year 2026-2027

        └── Projects

            └── Building Refurbishment

                └── Final Documentation

                    └── Approved by Customer

                        └── Version 4

                            └── Customer Approval Document.docx

Each folder name seems sensible by itself. Combined, however, they can push the full path beyond the limit supported by File Explorer or the application opening the file.

The issue is especially common with:

  • Files extracted from deeply nested ZIP archives
  • OneDrive and SharePoint synchronisation
  • Microsoft Teams document libraries
  • Migrated server data
  • Engineering, construction and legal project folders
  • Email attachments saved under several project folders
  • Backups that reproduce the entire original directory structure
  • Developer folders containing dependency trees
  • Files copied from macOS or Linux systems
  • Network shares with long server and share names

Try the Fastest Fix First

Before changing Windows settings, shorten the path temporarily.

Move the file closer to the drive root

Move the highest folder you can access to a location such as:

C:\Temp

A path that previously started with:

C:\Users\Carl\OneDrive - Company Name\Documents\Customers\...

might then start with:

C:\Temp\...

This can remove dozens of characters immediately.

If the problem involves a ZIP file, move the ZIP archive to C:\Temp before extracting it. Extracting from your Downloads folder into another deeply nested folder can cause the resulting paths to become unnecessarily long.

Shorten the file or folder names

Rename the folders closest to the top of the structure. A change near the beginning shortens the path for every item beneath it.

For example:

Final Approved Technical Documentation

could become:

Final Docs

Likewise:

Customer Correspondence and Approval Records

could become:

Approvals

Avoid removing so much information that the folders become difficult to understand. The aim is a shorter, clearer structure—not a collection of unexplained abbreviations.

How to Enable Long Paths with Group Policy

Windows 11 Pro, Enterprise and Education normally include the Local Group Policy Editor.

You will need administrator privileges to change this setting.

  1. Press Windows key + R.
  2. Enter:

gpedit.msc

  1. Select OK.
  2. Navigate to:

Computer Configuration

> Administrative Templates

> System

> Filesystem

  1. Double-click Enable Win32 long paths.
  2. Select Enabled.
  3. Select Apply and then OK.
  4. Restart the computer.

The corresponding Windows setting allows compatible Win32 applications to use paths beyond the traditional MAX_PATH restriction. However, Microsoft explains that the application must also declare itself as long-path aware. (Microsoft Learn⁠)

If the application was not designed for long paths, enabling the policy may make no difference to that application.

How to Enable Long Paths Through the Registry

Windows 11 Home does not normally include the Local Group Policy Editor. You can instead enable long-path support through the Registry.

Incorrect Registry changes can affect Windows, so follow the path carefully.

Using Registry Editor

  1. Press Windows key + R.
  2. Enter:

regedit

  1. Select OK.
  2. Approve the User Account Control prompt.
  3. Navigate to:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem

  1. Find the value named:

LongPathsEnabled

  1. Double-click it.
  2. Set Value data to:

1

  1. Select OK.
  2. Restart Windows.

If the value does not exist:

  1. Right-click an empty area in the right-hand pane.
  2. Select New > DWORD (32-bit) Value.
  3. Name it:

LongPathsEnabled

  1. Set its value to 1.

The fact that you are using 64-bit Windows does not change the value type. It should still be created as a DWORD (32-bit) Value.

Using an Administrator Command Prompt

You can apply the same Registry setting with a command.

Open Command Prompt as administrator and enter:

reg add "HKLM\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f

Restart Windows after the command completes.

Using PowerShell

Open Windows PowerShell or Terminal as administrator and enter:

Set-ItemProperty `

  -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `

  -Name "LongPathsEnabled" `

  -Value 1

You can confirm the current setting with:

Get-ItemPropertyValue `

  -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" `

  -Name "LongPathsEnabled"

A result of 1 means the Windows setting is enabled.

Why Enabling Long Paths Sometimes Appears Not to Work

This is the part that causes the most confusion.

Microsoft requires two conditions for modern Win32 long-path behaviour:

  1. Long paths must be enabled in Windows.
  2. The application must declare that it is long-path aware.

If only the first condition is met, an older or incompatible application may still reject the path. (Microsoft Learn⁠)

You may therefore find that:

  • A PowerShell command can access the file but File Explorer cannot.
  • Robocopy can copy the folder but an older backup program cannot.
  • Windows can store the file but Word or Excel cannot open it.
  • A local path works but OneDrive refuses to synchronise it.
  • One ZIP program succeeds while another reports an error.
  • A modern application works but a legacy line-of-business application fails.

Long-path support is partly an application compatibility issue, not merely a Windows switch.

Use Robocopy to Move or Recover Long Paths

Robocopy is built into Windows and is often more reliable than dragging files through File Explorer.

To copy a folder and its subfolders:

robocopy "C:\Very Long Source Folder" "C:\Recovered" /E /R:1 /W:1

The options mean:

  • /E copies all subfolders, including empty ones.
  • /R:1 retries a failed file once.
  • /W:1 waits one second before retrying.

To move the files instead of copying them:

robocopy "C:\Very Long Source Folder" "C:\Recovered" /E /MOVE /R:1 /W:1

Use /MOVE carefully. Confirm that the destination contains a complete, usable copy before deleting anything manually.

Robocopy is Microsoft’s built-in command-line copying tool and supports options for copying data, attributes, security information, directory trees and restartable transfers. (Microsoft Learn⁠)

Do not use

/MIR

casually

You may see guides recommending:

/MIR

This mirrors the source to the destination. It can also delete files from the destination that do not exist in the source.

For a simple recovery or long-path repair, /E is normally safer.

Shorten a Local Path with SUBST

The subst command can assign a drive letter to a deeply nested local folder.

Suppose the inaccessible data is located here:

C:\Users\Carl\Documents\Customers\Current Projects\Technical Documentation

You could temporarily assign that folder to drive X::

subst X: "C:\Users\Carl\Documents\Customers\Current Projects\Technical Documentation"

The same files can then be accessed through:

X:\

This removes the earlier folder structure from the path seen by some applications.

Microsoft documents subst as a command supported by Windows 11 for associating a path with a drive letter. (Microsoft Learn⁠)

To remove the temporary drive mapping:

subst X: /D

A subst mapping is normally temporary and may disappear after restarting or signing out. It should be treated as a workaround rather than a permanent information-management strategy.

Map a Network Folder Deeper in the Structure

Network paths can become long very quickly.

For example:

\\server-name\company-shared-data\customers\current-projects\technical-documentation

Instead of mapping the top-level share, an administrator may map a deeper folder directly to a drive letter:

P:\technical-documentation

This can shorten the visible path used by applications.

However, mapping a drive letter does not change the underlying server structure, and not every application calculates path length in the same way. It may solve the immediate problem without resolving the underlying folder-design issue.

On a managed business network, ask your IT provider before changing drive mappings. Existing scripts, shortcuts, applications and backup jobs may depend on the current path.

Deleting a File with a Path That Is Too Long

Sometimes the problem is not opening a file—it is deleting it.

Start by moving or renaming one of the higher-level folders. If File Explorer will not allow that, try mapping the parent folder with subst and deleting it through the shorter drive path.

PowerShell can also help:

Remove-Item -LiteralPath "C:\Temp\Problem Folder" -Recurse -Force

-LiteralPath tells PowerShell to use the path exactly as written rather than interpreting wildcard characters such as square brackets. Microsoft documents LiteralPath, Recurse and Force as parameters supported by Remove-Item. (Microsoft Learn⁠)

Before running a recursive deletion command:

  • Check the path carefully.
  • Confirm that you no longer need the data.
  • Keep a backup where appropriate.
  • Avoid running it against a broad folder such as C:\Users or the root of a drive.

There is no Recycle Bin safety net when many command-line deletion methods are used.

The Extended Path Prefix

Some Windows tools and applications can use an extended path beginning with:

\\?\

For a local path, that may look like:

\\?\C:\Very Long Folder Structure\Project\File.txt

For a network location, the extended UNC format is:

\\?\UNC\server\share\folder\file.txt

Microsoft explains that extended-length paths can allow compatible Unicode file functions to reach paths far beyond the traditional MAX_PATH limit. (Microsoft Learn⁠)

This prefix is primarily a technical and scripting solution. File Explorer and many everyday applications will not necessarily accept it when pasted into a normal file dialog.

Do not expect adding \\?\ to a path to repair an application that was never designed for long-path support.

OneDrive and SharePoint Have Their Own Limit

Enabling Windows long paths does not remove OneDrive or SharePoint restrictions.

Microsoft currently states that the entire decoded path for a file stored in OneDrive or SharePoint—including the file name—cannot exceed 400 characters. (Microsoft Support⁠)

The synchronised location on the computer also adds a local path before the cloud folders.

For example:

C:\Users\Carl\OneDrive - Hamilton Group\

Those characters are already being used before the project folder structure begins.

This means a document may fit within the SharePoint cloud limit but still cause trouble in a particular desktop application or local synchronisation location.

Practical OneDrive and SharePoint fixes

  • Shorten the names of document libraries.
  • Remove unnecessary folder levels.
  • Rename excessively descriptive folders.
  • Use metadata and views instead of reproducing every category as a folder.
  • Move the OneDrive sync root to a shorter local location where appropriate.
  • Avoid duplicating the customer, department and project name at every level.
  • Test important files in their normal desktop applications.
  • Review paths before carrying out a large migration.

Do not use Registry changes as the only fix for a SharePoint structure that is already close to the 400-character cloud limit.

ZIP Files and Extracted Archives

ZIP archives frequently contain paths created on another computer or operating system. The files can sit harmlessly inside the archive but exceed an application’s limit when extracted.

Try this order:

  1. Move the ZIP file to:

C:\Temp

  1. Rename the ZIP file to something short.
  2. Extract it directly into:

C:\Temp\Extracted

  1. Rename or reorganise the extracted folders.
  2. Move the cleaned-up data to its intended destination.

Avoid extracting a deeply nested archive directly into Downloads, OneDrive or an already complicated project structure.

If the archive came from an unknown sender, scan it before extracting and do not run executable files from it.

Should You Rename Everything with Abbreviations?

Not necessarily.

A folder system built entirely from abbreviations can become just as problematic as a long one. Users may create duplicate folders because nobody remembers what names such as TDR, FAV3 or CAPP mean.

A better structure uses concise, recognisable names.

Instead of:

Final Approved Customer Documentation Version Three

consider:

Approved Docs v3

Instead of:

Information Received from the Customer for Review

consider:

Customer Input

The aim is to make the path shorter without making the information harder to find.

Long Paths on Business Networks

Repeated long-path errors often indicate a wider information-management problem.

Common causes include:

  • Too many folder levels
  • Departments using different naming standards
  • Staff duplicating the same information in folder and file names
  • Old server structures copied into SharePoint unchanged
  • Project templates that create unnecessary folders
  • Multiple libraries being synchronised into already long local paths
  • Applications that still rely on legacy Win32 limits
  • Migration tools that add extra folder levels

Simply enabling long paths on every computer may hide the problem temporarily. It does not guarantee compatibility with backup platforms, document-management software, Microsoft 365 applications, security tools or customer systems.

A business should ideally define:

  • A maximum recommended folder depth
  • Consistent customer and project naming
  • Short document-library names
  • Rules for dates and version numbers
  • Where metadata should replace folders
  • How archived projects should be stored
  • Which applications must support the structure
  • Pre-migration path-length testing

A Sensible Troubleshooting Order

When Windows reports that a path is too long, work through these steps:

  1. Copy the affected data before making major changes.
  2. Move the top-level folder closer to the root of the drive.
  3. Shorten the highest folder names first.
  4. Move ZIP files to C:\Temp before extracting them.
  5. Enable Win32 long paths through Group Policy or the Registry.
  6. Restart Windows.
  7. Test the same file in more than one application.
  8. Use Robocopy if File Explorer cannot copy the data.
  9. Use subst to create a temporary shorter route.
  10. Check the separate OneDrive or SharePoint limit.
  11. Review the underlying folder structure if the issue keeps returning.
  12. Contact IT support before changing shared drives or company libraries.

Get Help Fixing Long File Paths Properly

A “path too long” message may look like a minor Windows annoyance, but recurring errors can interrupt backups, prevent cloud synchronisation, block migrations and leave important documents inaccessible.

Hamilton Group can help you recover files with excessively long paths, configure Windows 11 correctly, restructure shared folders and identify compatibility problems across OneDrive, SharePoint, Microsoft Teams and network storage.

We can also assess your existing folder structure before a cloud migration, helping prevent thousands of path-length errors from appearing after the data has been moved.

Call 0330 043 0069 or book a meeting with one of our experts to discuss a practical, secure solution for your files and business systems.