You can try them one by one to find the most appropriate one.
MiniTool Software collects some solutions that are proved to be effective to fix Destination Path Too Long. These are the file management functions that no longer have MAX_PATH restrictions if you opt-in to long path behavior: CopyFileW, CopyFile2, CopyFileExW, CreateFileW, CreateFile2, CreateHardLinkW, CreateSymbolicLinkW, DeleteFileW, FindFirstFileW, FindFirstFileExW, FindNextFileW, GetFileAttributesW, GetFileAttributesExW, SetFileAttributesW, GetFullPathNameW, GetLongPathNameW, MoveFileW, MoveFileExW, MoveFileWithProgressW, ReplaceFileW, SearchPathW, FindFirstFileNameW, FindNextFileNameW, FindFirstStreamW, FindNextStreamW, GetCompressedFileSizeW, GetFinalPathNameByHandleW.The error message of Destination Path Too Long can prevent you from copying or moving files or folders successfully. These are the directory management functions that no longer have MAX_PATH restrictions if you opt-in to long path behavior: CreateDirectoryW, CreateDirectoryExW GetCurrentDirectoryW RemoveDirectoryW SetCurrentDirectoryW. The application manifest must also include the longPathAware element. This registry key can also be controlled via Group Policy at Computer Configuration > Administrative Templates > System > Filesystem > Enable Win32 long paths. reg file which can set this for you, or use the PowerShell command from a terminal window with elevated privileges: In order for all apps on the system to recognize the value of the key, a reboot might be required because some processes may have started before the key was set. The registry key will not be reloaded during the lifetime of the process. The key's value will be cached by the system (per process) after the first call to an affected Win32 file or directory function (see below for the list of functions). The registry key Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled (Type: REG_DWORD) must exist and be set to 1.To enable the new long path behavior, both of the following conditions must be met: However, you must opt-in to the new behavior.
Starting in Windows 10, version 1607, MAX_PATH limitations have been removed from common Win32 file and directory functions. Enable Long Paths in Windows 10, Version 1607, and Later It is possible to create a path with the Windows API that the shell user interface is not able to interpret properly. The shell and the file system have different requirements. When using an API to create a directory, the specified path cannot be so long that you cannot append an 8.3 file name (that is, the directory name cannot exceed MAX_PATH minus 12). Any normalization that your application requires should be performed with this in mind, external of any calls to related Windows file I/O API functions. There is no need to perform any Unicode normalization on path and file name strings for use by the Windows file I/O API functions because the file system treats path and file names as an opaque sequence of WCHARs. Because you cannot use the "\\?\" prefix with a relative path, relative paths are always limited to a total of MAX_PATH characters. They indicate that the path should be passed to the system with minimal modification, which means that you cannot use forward slashes to represent path separators, or a period to represent the current directory, or double dots to represent the parent directory. These prefixes are not used as part of the path itself. For example, "\\?\UNC\server\share", where "server" is the name of the computer and "share" is the name of the shared folder. To specify such a path using UNC, use the "\\?\UNC\" prefix. The "\\?\" prefix can also be used with paths constructed according to the universal naming convention (UNC). The maximum path of 32,767 characters is approximate, because the "\\?\" prefix may be expanded to a longer string by the system at run time, and this expansion applies to the total length.