Destination path too long Windows 11

This tutorial is about How to Fix ‘Destination Path Too Long error’ Issue on Windows 11/10 PC. We will try our best so that you understand this guide. I hope you like this blog, How to Fix ‘Destination Path Too Long error’ Issue on Windows 11/10 PC. If your answer is yes, please do share after reading this.

So lets keep reading for intertesting info:

Check How to Fix ‘Destination Path Too Long error’ Issue on Windows 11/10 PC

Users get Destination Path Too Long error when trying to copy, move or delete certain files or folders on Windows operating systems. Most of the time, this error occurs because Microsoft has a limit of 256/260 folders and names. Even if the problem is more than 20 years old, the error still occurs on all recent versions of Windows. Note that this is not a limitation of NTFS, so changing the format will not fix the problem.

The problem is caused by a limitation in the Win32 API library. Most out-of-the-box applications (including File Explorer) will not work properly if the character limit is exceeded.

If you are currently struggling with this issue, we may be able to help. Below is a collection of methods that have enabled users in a similar situation to resolve the issue. Follow each possible solution in order until you find a method that fixes the destination path too long error.

  • Fix ‘Destination path too long error’ issue on Windows 11/10 PC
    • Shorten parent folder name
    • Change file extension to text temporarily
    • Enable long path support in Registry Editor
    • Use the xcopy command

Fix ‘Destination path too long error’ issue on Windows 11/10 PC

Shorten parent folder name

This is the easiest method to fix destination path too long. However, you should know that it is not always available, especially when you have numerous files that exceed the length limit.

If you only have individual files or folders affected by this issue, you can simply shorten their names and then run your operation to see if the issue is resolved. If you are still getting the Destination path too long error message, you should try the next solution.

Change file extension to text temporarily

If the problem occurs with a single .zip or .rar file, you can change the file extension to text and then change it back after moving the file. If you don’t know how to do this job, you can follow this guide:

  • Double click the file name and you can enter the edit mode.
  • Change the extension to txt.
  • Move the file to the destination location.
  • Rename the extension to its original format.

Enable long path support in Registry Editor

If you are using Windows 10 1607 or later, you can enable long path support via Registry Editor to resolve the issue. To be specific, you can disable the MAX_PATH limit on Windows. Before modifying the registry keys, it is better to make a backup copy of the key in case there is an accident. Here is a simple guide:

  • Press Win + R to open Run.
  • Type regedit and press Enter to open the Registry Editor.
  • Navigate to the following path:
    • Computer > HKEY_LOCAL_MACHINE > SYSTEM > Current Control Set > Control > File System.
  • Find LongPathsEnabled and double click on it.
  • Modify the value data to 1.
  • Click OK to keep the change.

Use the xcopy command

When we searched for this problem on the internet, we found that some users reflect that they solve it by using the xcopy command in an elevated command prompt. This method is worth trying. If you don’t know how to do this job, you can follow this guide:

  • Click Start and search for cmd.
  • Right click on the first result and select Run as administrator.
  • Copy and paste the following command line into the elevated command prompt:
    • xcopy *path to source files* *path to destination* /O /X /E /H /K
  • Press Enter.

Final words: How to Fix ‘Destination Path Too Long error’ Issue on Windows 11/10 PC

I hope you understand this article, How to Fix ‘Destination Path Too Long error’ Issue on Windows 11/10 PC. If your answer is no, you can ask anything via the contact forum section related to this article. And if your answer is yes, please share this article with your friends and family to give us your support.

If you are facing the error Destination Path Too Long when trying to copy or move a file to a folder in Windows, try the quick trick below. The reason you receive the error is that File Explorer failed to copy/delete/rename any pathname longer than 256 characters.

This is not the limitation of the NTFS file system, but the Win32 API library. In Win32 API the MAX_PATH value is 260. When you try to access file I/O on a specific path, the Windows API always checks if the path is longer than the MAX_PATH limit.

Most standard applications, including Windows Explorer (File Explorer), do not work correctly with long path files exceeding 256 characters. Under the file name, Windows understands the entire path, starting with the root of the drive, ending with the last subfolder, and the file name itself.

When using Unicode API functions, it’s possible to use a path of up to 32767 characters. Thanks to this, many third-party programs (the popular file managers, for example FAR and Total Commander) process files/folders whose path length exceeds 256 characters without any problems.

Note. Some programs use the UNC file path format (prefixed with “?”) to bypass the limitations of the Win32 API. For example, the absolute file path might look like this:

\\?\C:\folder1\subfolder1\toolongfilename

Due to max path length limitations, the administrator may encounter the following problems:

  • Users can create files and folders in a shared network folder that the administrator (or management scripts) cannot access locally;
  • Errors when synchronizing roaming profiles;
  • Errors in data recovery from shadow copies;
  • Incorrect calculation of the directories size;
  • Loss of files during migration and data transfer between servers, etc.

Full 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.

Destination path too long Windows 11
Destination Path Too Long error on Windows 10 21H2

Solution 1. Rename Parent Folder to Decrease the Full Path

The simplest way is to shorten the name of the parent folders, by reducing the total path length by simply renaming it. This workaround is not always applicable.

Another option is to create a symbolic link to a part of the path, thus shortening the total path length. To create a symbolic link to a folder with a long path, you can use the following command:

mklink /d c:\homelink “C:\verylongpathhere……”

Now you can perform all file operations (move, rename) with the directory to which the symbolic link is assigned (c:\homelink in our case). There will be no path length restrictions when you perform file operations against the symbolic link directory.

Solution 3. Use Subst Utility

Another option is to associate the problem folder to a virtual disk (in our example, Z:), using the built-in utility Subst. Thus, you can also shorten the path length:

Subst Z: “C:\verylongpathhere……”

Now you can work with the data on the Z: drive, in which the path to the files won’t exceed the Win32 API path limit. After the job is finished, you can delete the virtual disk using the Subst with the /d option:

Subst Z: /d

Solution 4. Hidden Share Path

Step 1

The quickest fix for this (especially if you need to simply migrate (move) a lot of folders from one place to another) is to map the folder with a long path to a drive letter.

You need to browse the problem folder using the UNC path. This can be either the path to an SMB share, the path to an administrative share available on any Windows computer (for example, \\servername\d$\users\your_long_path…), or the NT file naming format (\\?\d:\users\longpath). Copy the folder path to the clipboard.

Note. The “\\?\” prefix to the path string tells Windows to disable further parsing of the path string and send the path after the prefix directly to the file system driver. In this case, you can bypass the Windows API restrictions and exceed the MAX_PATH limits.

What you should do is browse the hidden share path and copy it to your clipboard.

Destination path too long Windows 11

Step 2

Then open File Explorer and select This PC. Click on the Map Network Drive button and select Map network drive. Depending on your OS, it might appear under the tools menu.

Destination path too long Windows 11

Step 3

Then simply paste your long folder path, select a drive letter you want to assign, and hit Finish.

Destination path too long Windows 11

Step 4

Now you will be able to copy the files/folders into this location without receiving the error.

Solution 5. How to Enable Win32 Long Path in Windows?

In current builds of Windows 10 and 11 (since Windows 10 version 1607) and on Windows Server 2019/2022, it became possible to disable the MAX_PATH limit for manifested win32 and Windows Store apps on the Windows operation system level without using the prefix \\?\. By default, this feature is disabled.

To enable the built-in support for long paths in Windows 10/Windows Server 2016/2019, use the Regedit.exe editor to set the LongPathsEnabled parameter of REG_DWORD in the registry key HKLM\SYSTEM\CurrentControlSet\ControlFileSystem with a value 1.

Destination path too long Windows 11

You can change this registry parameter with the following PowerShell command:

Set-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem -Name LongPathsEnabled -Value 1

Or you can enable long path support via the Local Group Policy Editor (Win + R > gpedit.msc > OK). Go to the following GPO section in the Group Policy editor: Computer Configuration > Administrative Templates > System > Filesystem. Open the policy parameter named Enable Win32 long paths and set it to Enabled.

Destination path too long Windows 11

Enabling Win32 long paths will allow manifested win32 applications and Windows Store applications to access paths beyond the normal 260 character limit per node on file systems that support it. Enabling this setting will cause the long paths to be accessible within the process.

Save the changes and update local group policy settings.

In both cases, the computer needs to be rebooted to make changes take effect. After a reboot, users and programs will be able to work without restrictions with files, which length of the path exceeds 256 characters. Now the files will only be affected by the NTFS file path limit of 32767 characters.

If you want to check if NTFS long path support is enabled on this computer, you can run the following PowerShell command:

(Get-ItemProperty "HKLM:\System\CurrentControlSet\Control\FileSystem").LongPathsEnabled

If the command returned a value of 1, then the policy is enabled.

Destination path too long Windows 11

Keep in mind, that to use the win32 NTFS long path, the application should be developed with this parameter enabled. As usual, such an option is enabled via the application manifest file.

An application manifest is a small file that contains some information about application compatibility, DPI support, etc. If applications are developed with NTFS long path support, then the longPathAware parameter must be added to the manifest file. For example:





true



In Visual Studio 2019 and MSBuild 16, this setting is enabled by default.

Once again, we want to draw your attention to the fact that the LongPathsEnabled parameter allows you to bypass the path length restrictions only for Windows applications that do not specify the MAX_PATH variable in the programming codes. 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 must use one of the tricks described above (symbolic link, substitution, or \\?\C:\ path format).

Win32 Long Paths GPO Not Working on Windows 10 File Explorer

There is bad news. File Explorer even in the latest builds of Windows 10 20H2 and Windows Server 2019 still doesn’t support NTFS long paths. This means that when you open such a file/folder, you will still receive the error: “Destination Path Too Long”.

Windows Explorer does not have a declaration in the manifest, and you will have to 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 is not ready for inclusion in File Explorer. You need to wait until Microsoft turns it on in Explorer, or use a third-party file management tool that is compatible with long paths.

However, in some applications, the MAX_PATH check is embedded in the code. About the max file path restrictions for .Net developers, see Solution 7 below.

Solution 6. Using Robocopy Command Line Tool to Copy and Move Files

You can use the built-in console Windows tool — robocopy to copy or move data. The utility allows you to correctly copy and synchronize files/directories with long paths.

For example, if you cannot delete the directory due to the path length limit, you can first move data from the directory using robocopy:

ROBOCOPY c:\folder1\folder2\folder3\longpath\ c:\tmp\ /MOVE /E

Destination path too long Windows 11

After that, you can delete the source directory:

Delete c:\folder1\folder2\folder3\longpath\ /q /f

Solution 7. Long File Path for .Net Developers

The Base Class Library (BCL) of the development environment for the .Net Framework has a built-in preliminary check for the admissibility of long directory and file names. Therefore .Net Framework developers may encounter a System.IO.PathTooLongException error in their programs.

Check for path length removed from BCL code in .Net Framework 4.6.2. Therefore, after updating the version of the .Net Framework, developers can use long paths in the UNC path format (\\?\C:\Very_long_path). When the LongPathsEnabled parameter is enabled in 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 older app versions (.Net 4.0):
















Solution 8. Long File Path in PowerShell .Net Developers

PowerShell is based on .Net, and in order for the Get-Item, Get-ChildItem, Remove-Item, and other cmdlets to work correctly with long file paths, you need to upgrade the .NET Framework to 4.5 or newer and install Windows Management Framework 5.1.

Tip. The current version of PowerShell can be found in the variable $PSVersionTable.

After that, when using file cmdlets instead of Path, you need to use the LiteralPath parameter. For example:

Get-ChildItem -literalpath \\?\C:\PS

Destination path too long Windows 11

Solution 9. Use 7-Zip to Perform File Operation with Long File Path

You can use the popular tool for managing 7ZIP to bypass the MAX_PATH restriction in Windows. 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 files in this directory from the 7-zip GUI. 7-Zip ignores Win32API restrictions on max path lengths.

Destination path too long Windows 11

Tip #1

There also is a great tool called “Long Path Tool” that works great to fix this. However it isn’t free, the methods above are.

Tip #2

Thank you, Colin Albright, for the comment below. Yes, you can also use 7-zip or any zip utility to fix the Destination Path Too Long problem. Sometimes on single files, this could be a better and faster solution. Just zip the folder up, and you are good to go.

  • About
  • Latest Posts

Brian Jackson started this blog in 2011. Brian has a huge passion for WordPress and technology for over a decade. Brian enjoys blogging, movies, and hiking.