When you try to copy, move, rename, or delete a file or folder on Windows 10, Windows 11, or Windows Server, you may encounter the following error:
Destination Path Too Long
The file name(s) would be too long for the destination folder. You can shorten the file name and try again, or try a location that has a shorter path.

Or:
An unexpected error is keeping you from copying the file.
Error 0x80010135: Path too long

Maximum File Path Length Limitations on Windows
The traditional MAX_PATH limit in many Win32 APIs is 260 characters, including the terminating null character. For directory creation, some legacy Win32 APIs impose a practical limit of 248 characters because they reserve additional characters for a possible 8.3-format filename. These are API-specific limitations, not universal NTFS limits, and actual behavior depends on the app and API being used.
Modern Windows apps can work with longer paths when they use APIs that support extended-length paths. For conventional Win32 paths, this typically requires the app to opt in through a longPathAware manifest and long-path support to be enabled in Windows. Extended-length paths using the \\?\ prefix have different rules and can support paths of up to approximately 32,767 characters, subject to API, filesystem, and component-specific limits.
Due to max path length limitations, you may encounter the following problems when managing files and folder from File Explorer and other legacy apps:
- Users can create files and folders in a shared network folder that the administrator cannot access locally;
- Errors when synchronizing roaming profiles;
- Errors in data recovery from VSS shadow copies;
- Wrong directory size displayed in folder properties;
- File loss when migrating or copying data between computers.
Recommended Approach and Best Practice
When you are dealing with long file paths on modern systems, we recommend you to follow a consistent method instead of relying on multiple workarounds:
- You need to enable long path support in Windows using Group Policy/registry (LongPathsEnabled = 1);
- You should prefer tools and commands that support the required long-path operation. Robocopy is useful for bulk file operations, while PowerShell can help with file management when the specific cmdlet and path format are supported;
- Where possible, you should design folder structures and automation scripts in order to avoid excessively deep nesting.
Keep in mind that this approach provides more predictable and stable behavior compared to relying on individual workarounds.
For Windows Server environments (including Windows Server 2022 and Windows Server 2025), you need to apply the same diagnostic method: identify the app performing the file operation, determine if the path is local or a UNC share, and verify long-path support in the relevant tool. Robocopy is useful for bulk file operations and migrations, but validate copy results, permissions, and logs before removing source data. You should test the examples in our guide on the target server version and workload before production use.
How to Fix the Destination Path Too Long on Windows
To work around the long paths problem in Windows, first try the following simplest and most effective methods:
- Shorten the name of the parent folder. Rename files and folders to something shorter;

- Enable long path support in Windows (see below). Unfortunately, this is not a universal method;
- For supported tools and APIs, try an extended-length path using the \\?\ prefix for a local path (for example, \\?\C:\folder1\subfolder1\filename.txt). For a network share, use the \\?\UNC\server\share\folder\filename.txt format. Note that this method works only when the app and the specific file operation support extended-length paths; it is not a universal fix for File Explorer/legacy apps.
- For Git for Windows, you can enable long-path support in Git’s config. To apply the setting system-wide, open an elevated Command Prompt or terminal and run:
git config --system core.longpaths true
In case you only need this setting for the current Windows user, run the following command instead. Administrator privileges are normally not required:
git config --global core.longpaths true
Next, we will look at several ways to workaround the long file path restriction on Windows 10 and 11.
Solution 1: Enable Win32 Long Path on Windows
You can enable Windows long-path support on supported Windows 10 and Windows 11 installations, but note that the setting does not remove all app-specific path-length limitations:
Windows 10 version 22H2 reached end of support on October 14, 2025. In case your organization continue to use Windows 10, then you should verify their ESU enrollment or the lifecycle status of their specific LTSC edition.
- Open the Local Group Policy Editor (Win + R > gpedit.msc > OK).
- Navigate to Computer Configuration > Administrative Templates > System > Filesystem.
- Enable the policy Enable Win32 long paths.

You can also enable long path support directly through the registry. Open the Regedit.exe editor, go to HKLM\SYSTEM\CurrentControlSet\Control\FileSystem reg key, and set the REG_DWORD parameter LongPathsEnabled to a value of 1.

Important. Enabling LongPathsEnabled does not make every Windows app long-path aware. File Explorer and other apps may still fail when working with deeply nested paths. The app must support long paths and use compatible APIs. If File Explorer continues to report a path-length error, you should use a supported command-line tool such as Robocopy/PowerShell, or try one of the alternative methods described below.
Alternatively, you can enable long-path support by changing the registry from an elevated PowerShell session. Run PowerShell as an administrator before executing the following command:
New-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' `
-Name 'LongPathsEnabled' `
-PropertyType DWord `
-Value 1 `
-Force
Reboot the computer to apply the changes. After rebooting, you should verify the setting is applied with the command:
(Get-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem).LongPathsEnabled
Starting with Windows 10, version 1607, Windows supports long paths for many Win32 file and directory APIs when long-path support is enabled and the app opts in by declaring longPathAware in its manifest. Windows 10 version 1607 or later is therefore a minimum OS requirement for this Win32 mechanism, not a guarantee that every app supports long paths.
For applications built on .NET Framework, the requirements also depend on the target framework and application config:
- Apps targeting .NET Framework 4.6.2 or later support long paths through the updated runtime behavior.
- Apps targeting earlier versions but running on .NET Framework 4.6.2 or later may require the Switch.System.IO.BlockLongPaths=false compatibility setting in the app config file.
Note that the Windows long-path setting alone does not override application-specific limitations.
Solution 2. Use 7-Zip to Perform File Operation with Long File Paths
To bypass the MAX_PATH restriction in Windows, you can use the popular 7ZIP archiver. Install 7-Zip, run the 7zFM.exe app, and paste the path to the problem folder into the address bar.
You can now perform any file operations on the files in this directory from the 7-Zip File Manager GUI. 7-Zip can work with long paths by using APIs that support extended-length paths.

Solution 3. Use a Directory Junction or Symbolic Link
A directory junction or symbolic link can provide a shorter path to a deeply nested local folder. This may help when an app encounters a path-length limitation, but it does not guarantee that every app/file operation will support long paths.
For a local directory, you can create a junction with mklink /J:
mklink /J "C:\homelink" "C:\verylongpathhere"
In typical Windows configs, creating a junction does not require an elevated Command Prompt. The target directory must exist, and the link path must not already exist.
Alternatively, create a directory symbolic link with mklink /D:
mklink /D "C:\homelink" "C:\verylongpathhere"
Creating a symbolic link may require an elevated Command Prompt or the Create symbolic links user right. On supported Windows configs, Developer Mode can allow eligible users to create symbolic links without elevation.
You can use a directory junction for a shortcut to a local directory, including a directory located on another local volume. Use a directory symbolic link when you need symbolic-link behavior or need to reference a directory on a supported network path. Unlike junctions, symbolic links can also target individual files when created as file symbolic links.
Both junctions and symbolic links can shorten the path used to access a deeply nested directory, but neither guarantees that every app will bypass its long-path limitations.
Important. These links shorten the path used to access the directory, but they do not remove every Windows/app path-length restriction. Don’t forget to test the required operation before relying on this workaround.
Solution 4. Use the SUBST Command to Overcome the Maximum Path Length
Another option is to assign a drive letter to a deeply nested local folder by using the built-in SUBST command. This creates a temporary drive-letter mapping that can shorten the path used to access the folder.
For example, run the following command in the same Windows security context as the app that will use the mapped drive:
subst Z: "C:\verylongpathhere"
You can then access the target directory through Z:. However, shortening the path does not guarantee that every app will support the required file operation.
Important considerations
- UAC and elevated processes: A SUBST mapping created in a standard, non-elevated session may not be visible in an elevated session, and vice versa. Create the mapping in the same context as the app that needs it. If necessary, you need to create it again from the elevated command prompt.
- Persistence: A normal SUBST mapping is temporary and is not automatically recreated after a Windows restart. If you need it again, rerun the command/implement an appropriate logon-time script.
- Cleanup: When you have finished using the mapping, remove it with the following command:
subst Z: /D

Before running SUBST, you need to ensure that the drive letter is available and that the target directory exists.
Solution 5. Map a Network Share to a Drive Letter
Mapping a network share to a drive letter can shorten the beginning of a UNC path, but it does not remove all long-path limitations. This method is useful only when the source or destination is a network share and the application supports the resulting path.
- Open File Explorer and select This PC.
- Click Map network drive.

- Select an available drive letter and enter a valid UNC path, such as \\server\share.

- Click Finish and test the required file operation.
Important. Do not enter a local extended-length path such as \\?\C:\folder or \\?\d:\users\longpath in the Map Network Drive wizard. Mapping a network share does not guarantee that File Explorer/another app can handle paths exceeding its supported limits.
For bulk file operations involving long paths, you should use Robocopy and verify the results before deleting/moving the source data.
Solution 6. Use Robocopy to Handle Long Paths
Robocopy is a built-in Windows command-line tool that can handle many file operations involving long paths. The appropriate command depends on whether you need to copy data, move it, or remove a directory that File Explorer cannot delete.
Copy Files with Logging
For a bulk copy, you can use Robocopy with explicit source and destination paths. The following example copies files and subdirectories, including empty directories:
robocopy "C:\Source Folder" "C:\Destination Folder" /E /COPY:DAT /DCOPY:DAT /XJ /R:1 /W:1 /LOG:"C:\Logs\LongPathCopy.log"
Create C:\Logs before running the command.
- /E copies subdirectories, including empty ones.
- /COPY:DAT copies file data, attributes, and timestamps.
- /DCOPY:DAT copies directory data, attributes, and timestamps where supported.
- /XJ excludes junction points to help avoid traversing junctions into other directory trees.
- /R:1 /W:1 limits retries and the wait between retries.
- /LOG saves the output to a log file.
In case the migration requires preserving NTFS permissions, ownership, and auditing info, you should use /COPYALL instead of /COPY:DAT, provided the account has the necessary privileges. Don’t forget to review the security implications before using this option.
Move Files Only After Verifying the Copy
For important data, use the copy-and-verify workflow described above instead of /MOVE. Run the copy command from the previous section, then review the Robocopy exit code and log. You need to check if the required files are present and accessible at the destination, and confirm that the required NTFS permissions have been preserved before removing the source data.
Do not rely on the Robocopy exit code alone as proof that the migration meets all requirements. For critical data, you should consider comparing file counts, sizes, and checksums, and validate access permissions before deleting the source.
Robocopy exit codes must be interpreted according to its documented status codes; a nonzero exit code does not automatically mean the operation failed.
| Exit Code | Meaning |
| 0 | No files were copied; no failures or differences requiring copying were detected. |
| 1 | One or more files were copied successfully. |
| 2 | Extra file/directories were detected in the destination. |
| 3 | Files were copied, and extra files/directories were detected in the destination. |
| 4 | Mismatched files or directories were detected. |
| 5 | Files were copied, and mismatches were detected. |
| 6 | Extra files and mismatches were detected; no files were copied. |
| 7 | Files were copied, and extra files and mismatches were detected. |
| 8 or higher | At least one copy failure occurred. |
Alternative: Direct Move with /MOVE
Robocopy also supports /MOVE, which deletes source files after copying them successfully. You should use this option only when immediate source cleanup is acceptable and the operation has been tested for the specific workload. For important production data, the copy-and-verify workflow above is safer because it allows you to validate the destination before removing the source.
robocopy "C:\Source Folder" "C:\Destination Folder" /E /MOVE /COPY:DAT /DCOPY:DAT /XJ /R:1 /W:1 /LOG:"C:\Logs\LongPathMove.log"
Before using /MOVE, you need to confirm that the destination and log paths are correct, that the destination has sufficient free space, and that you understand which source files and directories may be removed. Review the log and exit code after the operation.
Delete a Directory with Excessively Long Paths
If File Explorer cannot delete a directory because its nested file paths are too long, you can use Robocopy to mirror an empty directory to the target. This operation deletes the target directory’s contents that are not present in the empty source directory. You should use it only when you intend to remove all data from the target.
First, you need to create an empty source directory and a directory for the log file:
mkdir C:\EmptyDir
mkdir C:\Logs
Before running the destructive operation, you need to perform a dry run using /L. This lists the actions Robocopy would take without copying/deleting files. Review the output and verify that the source is empty and the destination is the exact directory you intend to clean up.
robocopy "C:\EmptyDir" "C:\FolderToDelete" /MIR /L /R:1 /W:1 /XJ
If the preview is correct, run the actual command:
robocopy "C:\EmptyDir" "C:\FolderToDelete" /MIR /R:1 /W:1 /XJ /LOG:"C:\Logs\LongPathCleanup.log"
The /L option is for preview only. Remove it from the actual command to perform the operation. You should not proceed if the preview shows unexpected source/destination paths.
Don’t forget to replace C:\FolderToDelete with the exact directory you want to empty. The /MIR option mirrors the empty source to the target and can delete the target’s contents.
The /XJ option excludes junction points from traversal. It prevents Robocopy from traversing junction points, but it does not guarantee that all junctions inside the target directory will be removed. After the cleanup, you should inspect the target directory for remaining files, subdirectories, and junctions before running rmdir. Do not remove /XJ blindly, because following junctions may expose data outside the intended target tree to the cleanup operation.
Review the Robocopy log and inspect the target directory after the cleanup. If files, subdirectories, or junctions remain, identify why they were not removed before proceeding. Remove any remaining junctions only after verifying their targets and confirming that the links themselves are intended for deletion. Once the target directory contains no remaining entries, remove the directory with rmdir. Run the command:
rmdir "C:\FolderToDelete"
Warning. You should not use /MIR as a general-purpose cleanup command. An incorrect source/destination path can cause data loss. If you need to preserve any files, you should use a copy-and-verify workflow instead.
Solution 7. Overcoming Long File Path Problem in PowerShell
PowerShell can help manage files and directories with long paths, but support depends on the PowerShell version, Windows config, filesystem provider, and the underlying file operation. The -LiteralPath parameter prevents wildcard characters such as [ and ] from being interpreted as patterns; it does not, by itself, bypass MAX_PATH.
For supported operations, you can test an extended-length path by using the \\?\ prefix. For example, to remove a directory tree, use the following:
$longPath = '\\?\C:\very\long\path'
Remove-Item -LiteralPath $longPath -Recurse -Force
Warning. Note that -Recurse -Force can permanently delete the specified directory tree and its contents. You should verify the target path before running the command. Test the operation on a non-production directory first.
If the command fails, you should not assume that adding \\?\ will solve the problem. Use a tool that supports the required operation, such as Robocopy for appropriate bulk file operations, and verify the result before deleting/moving source data.

The real question is why such a ridiculous shortcoming was implemented in Windows to begin with — the whole point of filenames and pathnames is to structure and label data sufficiently to be human-understandable. Limiting pathnames has ALWAYS been unacceptable is is shameful for MicroSoft to have done.
One workaround I used is running an Android file manager like Root Explorer, etc and make a SAMBA connection to the Windows 10 computer. Then, from the Android file manager, I can rename any Latin and/or Unicode file names that is longer than the 255 characters’ limitation – issue exhibited by Window Explorer. Android is built on top of Linux so it doesn’t have this limitation like the Windows Explorer application in Windows 10!
Another solution would be to install an Android emulator for Windows like Bluestacks, etc and run an Android file manager like Root Explorer, etc and rename Windows’ files with long names without any problems with file name’s length. Again, Android/Linux comes to the rescue!
@Mike: No, the solution suggested will only work for Windows applications that don’t specify the MAX_PATH variable in the programming codes, which is limited to 255 Latin characters, like Windows Explorer! So, Windows Explorer will NEVER work despite the registry’s mod and the group policy’s mod.
The workaround that doesn’t cost you a dime if you use Android/Linux is:
1. Root Explorer (Android free application)
2. BlueStacks (Android free emulator for Windows)
3. Any Android device that supports SAMBA network connection.
One workaround I used is running an Android file manager like Root Explorer, etc and make a SAMBA share/connection to the Windows 10 computer. Then, from the Android file manager, I can rename any Latin and/or Unicode file names via the SAMBA share, without suffering the file’s limitation issue exhibited by Windows Explorer itself!
Another solution would be to install an Android emulator for Windows like Bluestacks, etc and run an Android file manager like Root Explorer, etc and rename Windows’ files with long names without any problems with file name’s length. Again, Android/Linux comes to the rescue!
It is located here
Computer\ HKEY_LOCAL_MACHINE\ SYSTEM\ CurrentControlSet\ Control\ FileSystem
for me