Destination Path Too Long Error - How to Solve it

The destination path too long error in Windows 10 (or Windows 11)  is one of these errors that can leave you bewildered. Usually it kicks in just when you are in the flow of copying your files or even when you are trying to create a new folder a few levels deep in a directory structure. I can’t believe that after so many years of existence and new incarnations of Windows versions, Microsoft still struggles with something seemingly as simple as a “long” filename.

Luckily there are several solutions when you are dealing with the destination path too long error, and that is exactly what I will be unpacking in this article.

The problem has to do with an environment variable called MAX_PATH in versions of Windows earlier than Windows 10 version 1607, which defines a maximum filename length of 260 characters.

Anyways, in this article I will describe a few solutions that you can use to fix the destination path too long error, so please read on if you are struggling with this.

Destination Path Too Long - A Little More in Detail

You can skip this part if you want to go straight to the part that explains how to solve the destination path too long error, but here I will first give a little more details about the error you get when your destination path is too long, which is when Windows will start complaining that “The file name(s) would be too long for the destination folder”.

This is what the error looks like.

The destination path too long error

As you can see, Windows will suggest that “You can shorten the file name and try again, or try a location that has a shorter path”.

Also, before I go any further, I also need to point out that your file system needs to be NTFS (not FAT32) if you want to be able to enable long filenames in Windows.

As mentioned above, there’s a 260 character filename length limitation defined in MAX_PATH for Windows versions prior to Windows 10 version 1607, which has moved in newer Windows versions and is now called Win32 long paths.

To determine the length of a filename, we must not only consider the name of the file itself, but the entire path of the filename, starting with the drive letter, a colon, a backslash and then the “path” to the folder where the file is located, for example:

c:\Temp\a-very-long-folder-name-level-1\a-very-long-folder-name-level-2\name-of-your-file.txt

The entire path counts as the filename length for your file, which already starts to explain why some filenames exceed the 260 character limit if they are living in a folder nested several levels deep in a folder tree.
Still it feels strange that in a modern operating system such as Windows 10 or Windows 11, filename length is limited to 260 characters and when you get the destination path too long error, you are probably not inclined to follow the suggestion to shorten the filename. After all, you want to be able to use the naming convention you like and come up with names that make sense to you.

Luckily there are a few solutions that you can use to solve this problem.

As you start searching for solutions for the destination path too long error, you will find solutions that describe how you can change the registry or use the local group policy editor to fix your problem. Other solutions talk about how you can use PowerShell commands to copy your files to circumvent the destination path too long error.

For the sake of completeness, I will also cover these solutions further down below in this article, but I will also add that these solutions alone probably won’t help in your particular case. That’s because these solutions focus on enabling long file names in Windows 10 (or Windows 11), but in order for long file names to actually work, you will need to make use of  manifested win32 applications or Windows Store applications to access paths beyond the normal 260 character limit. Windows File Explorer is not one of the programs that will recognize the long path feature yet.

That means that you can enable long paths all day long, but you will still get the destination path too long error when you are trying to copy your files using File Explorer. So after enabling long path names on your system, you’ll still have to consider using a utility like Total Commander to be able to copy your files.

But first let’s start by enabling long path names in Windows.

Solution 1: How to Enable Win32 Long Paths in Windows

In order to enable Win32 long paths in Windows, open registry editor and navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem. Then set the dword value called LongPathsEnabled to 1.

Let’s go over these steps in more detail. Press the Windows logo key + r on your keyboard to open the run box.

Windows logo key + r

In the run box, type “regedit” (without the quotes) and click ok.

Type regedit and click ok

The Windows registry editor will now open. Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem and double click the value LongPathsEnabled.

Set LongPathsEnabled to deal with destination path too long errors

This will open a window where you can set the value to decimal 1 and click ok to confirm.

Enter value 1 decimal

Now you have to restart the computer for the changes to take effect. You have now successfully enabled Win32 long paths in Windows using the registry editor. Please not that this alone will not deal with the destination path too long error message. We'll come to that further down below.

There's also another way of enabling Win32 long paths which is via the local group policy editor.

Solution 2: How to Enable Win32 Long Paths Using Group Policy Editor

Open the local group policy editor (gpedit.msc) and navigate to Computer Configuration\Administrative Templates\System\Filesystem. In the right pane of Filesystem,  double click on the Enable Win32 long paths policy and select “enabled”.

Again, let’s go over these steps in more detail. First, press the Windows logo key + r on your keyboard to open the run box.

Press the Windows logo key + r

In the run box, type “gpedit.msc” (without the quotes) and click ok.

Type gpedit.msc and click ok

In the local group policy editor, go to Computer Configuration\Administrative Templates\System\Filesystem and then double click on “Enable Win32 long paths”.

Double click Enable Win32 long paths

In the next screen, select “Enabled” and click ok to confirm.

Click enabled and then click ok

Now you can close the local group policy editor and restart your computer for the changes to take effect.

This concludes the second option to enable Win32 long paths (using the local group policy editor).

Now that you have enabled Win32 long paths using one of the two methods described above, your computer is ready to understand filenames with lengths that extend beyond the 260 character limit.

However, as mentioned earlier, in order to be able to do that, you need to use applications or programs that know how to deal with that. Unfortunately, File Explorer does not fall in that category. That’s why you’ll sometimes find suggestions to use Powershell commands to circumvent destination path too long errors.

Solution 3: Use PowerShell to Avoid Destination Path Too Long Errors

Using the PowerShell to copy your files requires a bit of an understanding of PowerShell commands, so if you’re not familiar with these you might be better off using the next method. If you are somewhat familiar with PowerShell file commands, here’s what the scenario could look like.

Click the Windows start button and type powershell and click PowerShell under the search results.

Type powershell on the start menu

In the PowerShell window, use the cd command to go to the source directory that you want to copy.

Use the cd command to go to the source folder

Then, use the Copy-Item command to copy your file or folder to another location.

Copy-Item -Path "C:\example-folder\*" -Destination "C:\example-destination" -Recurse

The PowerShell command will be able to successfully copy over any long path names without the destination path too long error.

PowerShell commands are not for everyone. Sure it can't be the case that we need to get comfortable with PoweShell commands in order to be able to copy files with long filenames.

If you don’t particularly care about PowerShell commands, you can always download Total Commander, a shareware file manager software that can deal with long filenames.

Solution 4: Using Total Commander to Solve The Destination Path Too Long Error

Total Commander is a small shareware file manager for Windows that can be downloaded for free from the ghisler.com website.

It requires a little getting-used to because it looks a bit different from File Explorer in Windows, but it will get the job done.

Once you have downloaded and installed Total Commander, you can use the program to copy your files and folders with long filenames.

To do so, use the left part of the Total Commander window to navigate to your source folder (the one that you want to copy). In the right pane of the screen, navigate to where you want the file or folder to be copied.

Using Total Commander to deal with long filenames

Now click the copy button at the bottom of the screen to start your copy operation.

As you can see in the image above, Total Commander also has you covered if you need to perform move or delete operations on your long filename folders as well.


If you've enjoyed this article or found it useful, I'd appreciate it if you'd let me know by clicking the Like (or Share) button below. Thank you!


New! Comments

Have your say about what you just read! Leave me a comment in the box below.
Enjoy this page? Please pay it forward. Here's how...

Would you prefer to share this page with others by linking to it?

  1. Click on the HTML link code below.
  2. Copy and paste it, adding a note of your own, into your blog, a Web page, forums, a blog comment, your Facebook account, or anywhere that someone would find this page valuable.