when you face the errorDestination path too longIf you're trying to copy or move a file to a folder in Windows, try the following quick trick. The reason you are getting the error is that File Explorer was unable to copy/delete/rename a path longer than 256 characters.
This is not the limitation of the NTFS file system, but the Win32 API library. In the Win32 API, the value of MAX_PATH is 260. Whenever you try to access file I/O on a specific path, the Windows API always checks if the path is greater than the MAX_PATH limit.
Most standard applications, including Windows Explorer (File Explorer), do not work correctly with files with long paths greater than 256 characters. Under the file name, Windows understands the full path, starting with the root of the drive, ending with the last subfolder and the name of the file itself.
When using Unicode API functions, you can use a path of up to 32767 characters. Thanks to this, many third-party programs (popular file managers, for example, FAR and Total Commander) easily process files/folders whose path length exceeds 256 characters.
ADVERTISEMENT
To use🇧🇷 Some programs use the UNC file path format (preceded by "?") to get around Win32 API limitations. For example, the absolute file path might look like this:
\\?\C:\pasta1\subpasta1\toollongfilename
Due to the limitations of the maximum path length, the administrator may encounter the following issues:
- Users can create files and folders in a shared network folder that the administrator (or administration scripts) cannot access locally;
- Failed to sync roaming profiles;
- Failed to restore snapshot data;
- Incorrect calculation of directory size;
- Loss of files during migration and data transfer between servers, etc.
Fixed destination path too long
Complete error:
Destination path too long
The file names would be too long for the destination folder. You can shorten the filename and try again, or use a location with a shorter path.

Solution 1. Rename parent folder to shorten full path
The easiest way is to shorten the name of the parent folders by reducing the total path length simply by renaming them. This workaround is not always applicable.
Solution 2. Create a symbolic link
Another option is to create a symbolic link for part of the path, thus reducing the total length of the path. To create a symbolic link to a folder with a long path, you can use the following command:
mklink /d c:\homelink „C:\caminomuylargo……“
Now you can perform all file operations (move, rename) with the directory the symlink is assigned to (in our case c:\homelink). There are no path length limitations when performing file operations on the symbolic links directory.
Solution 3. Use the Subst utility
Another option is to map the problem folder to a virtual drive (Z: in our example) using the built-in utilitySubstance🇧🇷 Then you can also shorten the path length:
noun Z: „C:\very long way here……“
You can now work with data on the Z: drive where the path to the files does not exceed the Win32 API path limit. After the job is complete, you can delete the virtual disk using Subst with the /d option:
Deputy Z: /d
Solution 4. Hidden share path
Step 1
The quickest solution to this (especially if you simply need to migrate (move) a lot of folders from one place to another) is to assign the folder with a long path to a drive letter.
You need to navigate to the problem folder using the UNC path. This can be the path to an SMB share, the path to an administrative share available on any Windows machine (for example, \\servername\d$\users\your_long_path...) or the NT filename format ( \\ ?\d:\user\longpath). Copy the folder path to the clipboard.
To use🇧🇷 The path string prefix "\\?\" tells Windows to disable further parsing of the path string and send the path after the prefix directly to the file system driver. In that case, you can bypass and overcome Windows API limitationsMAX_PATHLimits.
What you need to do is find the hidden share path and copy it to your clipboard.
ADVERTISEMENT
step 2
Then open File Explorer and select This PC. Click the Map Network Drive button and selectnetwork drive🇧🇷 Depending on your operating system, it may appear under the Tools menu.
step 3
Then just paste the long folder path, choose a drive letter you want to assign, and click Finish.
Step 4
Now you can copy the files/folders to that location without getting the error.
Solution 5. How to enable Win32 Long Path in Windows?
In recent builds of Windows 10 and 11 (since Windows 10 version 1607) and in Windows Server 2019/2022, it was possible to disable the MAX_PATH limit for manifested win32 and Windows Store apps at the Windows OS level without the \ prefix \ to use. ?\. By default, this resource is deactivated.
To enable built-in long path support on Windows 10/Windows Server 2016/2019, use theRegedit.exeEditor to configure theLongPathsEnabledREG_DWORD Parameters in Registry KeyHKLM\SISTEMA\CurrentControlSet\ControlFileSystemwith a value1.
ADVERTISEMENT
You can change this registry parameter with the following PowerShell command:
Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem -Name LongPathsEnabled -Valor 1
Or, you can enable long path support through the Local Group Policy Editor (Win + R > gpedit.msc > OK). In the Group Policy Editor, go to the following GPO section: Computer Configuration > Administrative Templates > System > File System. Open the policy parameter namedEnable Win32 Long Pathsand set it to Enabled.
Enabling long Win32 paths allows manifest Win32 apps and Windows Store apps to access paths beyond the normal limit of 260 characters per node on supported file systems. Enabling this setting makes long paths within the process accessible.
Save the changes andUpdate local group policy settings.
In both cases, the computer must be restarted for the changes to take effect. After a reboot, users and programs can work with files whose path length exceeds 256 characters without restrictions. Files are now only affected by the NTFS file path limit of 32,767 characters.
If you want to verify that NTFS long path support is enabled on this computer, run the following PowerShell command:
ADVERTISEMENT
(Get-ItemProperty „HKLM:\System\CurrentControlSet\Control\FileSystem“).LongPathsEnabled
If the command returns a value of1, then the policy is enabled.
Note that to use the Win32 NTFS long path, the application must be developed with the parameter enabled. As usual, this option is enabled through the app's manifest file.
An app manifest is a small file that contains information about app compatibility, DPI support, etc.longPathAware-The parameter must be added to the manifest file. For example:
<Anwendung xmlns=”urn:schemas-microsoft-com:asm.v3″><windowsSettings xmlns:ws2=”http://schemas.microsoft.com/SMI/2016/WindowsSettings”><ws2:longPathAware>true</ ws2:longPathAware></Configuração do Windows></aplicativo>
In Visual Studio 2019 and MSBuild 16, this setting is enabled by default.
Once again, we would like to draw your attention to the fact that the LongPathsEnabled parameter allows you to bypass path length limitations only for Windows applications that do not specify the MAX_PATH variable in their programming code. This means that Windows Explorer will not work with a long file path, even after enabling the LongPathsEnabled registry setting or the Enable Win32 Long Paths policy setting. To manage files with a long path in File Explorer, you need to use one of the tricks described above (symlink, substitution or path format \\?\C:\).
Win32 Long Path GPO not working in Windows 10 File Explorer
There is bad news. File Explorer still doesn't support long NTFS paths even on newer versions of Windows 10 20H2 and Windows Server 2019. This means that when opening this file/folder you still get the error: "Destination path too long" .
Windows Explorer does not have a manifest declaration and you must use one of the tricks described in this article to access long paths in Windows.
We saw the following comment from a Microsoft employee:
This feature cannot be included in File Explorer. You'll have to wait for Microsoft to enable it in Explorer, or use a third-party file management tool that supports long paths.
However, in some applications, the MAX_PATH check is built into the code. See Solution 7 below for maximum file path limitations for .NET developers.
Solution 6. Using the Robocopy command line tool to copy and move files
You can use Robocopy, the Windows built-in console tool, to copy or move data. The utility allows you to correctly copy and synchronize files/directories with long paths.
For example, if you cannot remove the directory due to the path length limit, you can first move the directory data using robocopy:
ROBOCOPY c:\Ordner1\Ordner2\Ordner3\longpath\ c:\tmp\ /MOVER /E
After that you can delete the source directory:
Eliminar c:\carpeta1\carpeta2\carpeta3\longpath\ /q /f
Solution 7. Long file path for .Net developers
The Development Environment Core Class Library (BCL) for the .Net Framework has a built-in pre-check for long directories and file names. Therefore, .Net Framework developers may encounter System.IO.PathTooLongException error in their programs.
Verify that the path length has been removed from the BCL code in .Net Framework 4.6.2. Therefore, developers can use long paths in UNC path format (\\?\C:\Very_long_path) after upgrading the .NET Framework version. If the LongPathsEnabled parameter is enabled on Windows 10/Windows Server 2016, it is possible to work correctly with files that have paths of almost any length.
To do this, use Net Framework 4.6.2 (and newer) when building applications, or use the following application configuration file for earlier versions of the application (.Net 4.0):
<?xml version=”1.0″ encoding=”utf-8″?><configuration><startup><supportedRuntime version=”v4.0″ sku=”.NETFramework,Version=v4.0″/></startup> <runtime><AppContextSwitchOverrides value=”Switch.System.IO.UseLegacyPathHandling=false;Switch.System.IO.BlockLongPaths=false” /></runtime></configuration>
Solution 8. Long file path in PowerShell .Net Developers
PowerShell is .Net based, and for Get-Item, Get-ChildItem, Remove-Item, and other cmdlets with long file paths to work correctly, you must update the .NET Framework to 4.5 or later and install Windows Management Framework 5.1.
tip🇧🇷 The current PowerShell version can be found in the $PSVersionTable variable.
Thereafter, when using file cmdlets, you must use LiteralPath parameter instead of Path. For example:
Get-ChildItem -literalpath \\?\C:\PS
Solution 9. Use 7-Zip to perform long file path archive operation
You can use the popular 7ZIP management tool to bypass the MAX_PATH limitation in Windows. Install 7-Zip, run the 7zFM.exe application and paste the path to the problem folder in the address bar.
You can now perform all archiving operations on files in this directory from the 7-Zip GUI. 7-Zip ignores Win32API restrictions on maximum path length.
Tip #1
There is also a great tool called the Long Path Tool that works really well to fix this. However, it's not free, the above methods are.
Tip #2
Thank you Colin Albright for the comment below. Yes, you can also use 7-Zip or any zip utility to fix destination path too long issue. For individual files this can sometimes be a better and faster solution. Just zip the folder and you're done.
- ONE
- Latest posts
brian jackson
Brian Jackson started this blog in 2011. Brian has had a deep passion for WordPress and technology for over a decade. Brian enjoys blogging, movies and hiking.
Latest posts by Brian Jackson(see it all)
- How to add calendar permissions in Office 365/Exchange via PowerShell?- 6. October 2022
- Using the Tnsnames.ora File in SQL Developer- July 12, 2022
- Activate Windows with KMS server- July 2, 2022
FAQs
How do I fix path too long error? ›
If you see this error there are several solutions: 1) Instead of right clicking on the file to extract it, left click on the file to enter the zip directly. Then look for long folder names and make them shorter. Then close the zip file and extract it again.
How do I shorten a long file path? ›Leave out “a, an, the” and other helper words and drop vowels to shorten names. To delete the file, right click on the file name and choose “RENAME” and shorten the name. Once you do that you should be able to copy, move or delete the file. Remember: Use short descriptive name for files and folders.
How do I copy a file that is too large for destination FileSystem? ›How do I fix file too large for destination file system error? To fix the "File is too large for the destination file system" error, you have to format the destination drive to NTFS for exFAT. Unlike FAT32, NTFS and exFAT support storing files larger than 4GB that FAT32 can't.
How do I turn off path limit? ›...
Choose the DWORD (32-bit) Value.
- Right-click the newly added key and choose Rename.
- Name the key LongPathsEnabled.
- Press Enter.
- Open File Explorer and navigate to the directory where your files are located.
- Press and hold Shift, then right-click on an empty area. ...
- Enter the following command in the Command Prompt window: DIR /X.
In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters. A local path is structured in the following order: drive letter, colon, backslash, name components separated by backslashes, and a terminating null character.
What does path too long error mean? ›Possible causes of this error
The file path is longer than 260 characters . Your Windows system does not support file path with name longer than 260 characters.
When the file is too large for the destination file system error, convert FAT32 to NTFS file system. For this, there is no need for formatting if you are using the AOMEI Partition Assistant Standard tool. This will convert the file system on your hard drive from one to another.
Why does a file say it's too large for destination? ›Based on mentioned above, “The file is too large for the destination file system” issue results from the limit of maximum size of the destination drive file system. Hence, you can check your drive file system. Most of time, it may be either FAT or FAT32. Then, what you can do is to convert file system to NTFS.
What is the best way to transfer large files? ›- Upload your files to a cloud storage service, and share them or email them to others.
- Use file compression software, like 7-Zip.
- Purchase a USB flash drive.
- Use Jumpshare, a free online service.
- Try Sendy PRO.
- Use a VPN.
- Transfer files using SFTP.
How do I get Windows 10 to accept file paths over 260 characters? ›
Navigate to Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem. Double click Enable NTFS long paths. Select Enabled, then click OK.
Why does Windows have a file path limit? ›The 260-character path limit is due to fixed buffers in the runtime library for DOS/Windows path processing (e.g. ANSI <=> Unicode, working directory, and DOS<=>NT path conversion).
How do I enable paths longer than 260 characters? ›Navigate to Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem. Double click Enable NTFS long paths. Select Enabled, then click OK.
How do I get Windows 7 to accept file paths over 260 characters? ›Hit the Windows key, type gpedit. msc, and press Enter. Navigate to Local Computer Policy > Computer Configuration > Administrative Templates > System > Filesystem OR continue to > NTFS. Then double-click the Enable NTFS long paths option and enable it.
Why does Windows have a path length limit? ›The 260-character path limit is due to fixed buffers in the runtime library for DOS/Windows path processing (e.g. ANSI <=> Unicode, working directory, and DOS<=>NT path conversion).
What is the maximum file path length in Windows 10? ›In the Windows API (with some exceptions discussed in the following paragraphs), the maximum length for a path is MAX_PATH, which is defined as 260 characters. A local path is structured in the following order: drive letter, colon, backslash, name components separated by backslashes, and a terminating null character.
How do I delete a destination path too long? ›- Open File Explorer and navigate to the directory where your files are located.
- Press and hold Shift, then right-click on an empty area. ...
- Enter the following command in the Command Prompt window: DIR /X.
Maximum file size: 256 terabytes. Maximum number of files on disk: 4,294,967,295. Maximum number of files in a single folder: 4,294,967,295.
How do I enable long paths? ›Press Win + R keys on your keyboard and type gpedit. msc then press Enter. Group Policy Editor will be opened. Go to Local Computer Policy -> Computer Configuration -> Administrative Templates -> System -> Filesystem, then enable the Enable Win32 long paths option.