[SOLVED] 'Path Too Long error' - Far more Frequent in Windows 10

Chaz-Dave

Distinguished
Jul 22, 2016
20
0
18,510
Path Too Long - Far more Frequent in Windows 10

I have just moved from using Windows 7 to Windows 10. I have found that the 'path too long' error is far more frequent in Windows 10 than in 7. This has been obvious to me because I frequently transfer alot of files. Over the years I have managed to remove or shorten the file names that obstruct the smooth duplication of files. However with some files I have literally halved the file names that were effortlessly transferred over by Windows 7 but have still not been able to transfer them.

I was wondering if anyone had any insight into this?
 
Solution
edit: i figure I should look it up:
docs indicate that before windows 10 build version 1607
max path was set to 260. after that build it is set by a registry key
"Starting in Windows 10, version 1607, MAX_PATH limitations have been removed from common Win32 file and directory functions. However, you must opt-in to the new behavior. "

https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd

so I am not sure what it is set to anymore.
edit2:
on my window 10 build current version which was upgraded from a old build the registry key is set to 0 (path limited by windows api)


-------------
-the max path length depends on the interface.
old interface standard was 256 bytes -2 bytes=254...

Chaz-Dave

Distinguished
Jul 22, 2016
20
0
18,510
The "path" limit is 256 characters.
This includes the folder and subfolders, as well as the actual file name.

This has not changed with Win 10.

Exactly! - so why I am I experiencing it more on Windows 10?
I have noted in my preamble, that despite reducing some of the files by half I still get the error (I have mentioned this all above)
 

Chaz-Dave

Distinguished
Jul 22, 2016
20
0
18,510
I expect you're seeing it more now, just due to time and frequency of doing it.
Not anything to do with Win 10 vs 7.

As noted above "This has been obvious to me because I frequently transfer alot of files" It is because I frequently transfer files back and forth that I can ACTUALLY see the difference, hence the comparative difference ...

If I may say (without sounding rude) you seem to be thoroughly resisting the idea that there could be an actual answer to my question...
 

DSzymborski

Titan
Moderator
As noted above "This has been obvious to me because I frequently transfer alot of files" It is because I frequently transfer files back and forth that I can ACTUALLY see the difference, hence the comparative difference ...

If I may say (without sounding rude) you seem to be thoroughly resisting the idea that there could be an actual answer to my question...

If I may say (without sounding rude) do you actually have data supporting this outside of your observation? I do a lot of data consulting in my day-to-day and one of the fundamental truths is that people are absolutely terrible at this kind of systematic observation of data such as these.

If you have not made changes or any other trick that can alter filename usage, there is no change in the limits between Windows 7 and Windows 10. It's far more believable that you're mistaken or that you are not considering path lengths, or that you made some kind of alteration that you have forgotten about (which we'd have no way to determine) than there's a different fundamental Windows structure that exists solely in your Windows install. Windows 10 has been around for seven years; if there was some kind of bug inherent in Windows 10 that caused more frequent long filename transfer errors, the probability of it being uncovered here and now is effectively zero.
 

USAFRet

Titan
Moderator
As noted above "This has been obvious to me because I frequently transfer alot of files" It is because I frequently transfer files back and forth that I can ACTUALLY see the difference, hence the comparative difference ...

If I may say (without sounding rude) you seem to be thoroughly resisting the idea that there could be an actual answer to my question...
Seeing as there is NO difference between Win 7 and 10 for path length....it is not due to Win 10.
256 characters has been the limit forever.

What may happen is....
Folder/subfolder/subfolder/subfolder/big file name.
It will allow you to save that file in that path, even though it exceeds the limit.

Then, when you try to 'move' that whole thing...it fails.
 
edit: i figure I should look it up:
docs indicate that before windows 10 build version 1607
max path was set to 260. after that build it is set by a registry key
"Starting in Windows 10, version 1607, MAX_PATH limitations have been removed from common Win32 file and directory functions. However, you must opt-in to the new behavior. "

https://docs.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd

so I am not sure what it is set to anymore.
edit2:
on my window 10 build current version which was upgraded from a old build the registry key is set to 0 (path limited by windows api)


-------------
-the max path length depends on the interface.
old interface standard was 256 bytes -2 bytes=254 bytes
you could violate this by creating files with relative paths.

-Each file system also has various different limits on path length and reserved names. ntfs with something like a 32k path length limit.

-network redirector also has its own limits.

- interop platforms connecting to windows servers were not limited by the windows api but by the filesystem limits. Any unix variant could make long paths on the file shares then the windows tools would break.

These unix based interop clients also did not have all of the reserved file name rules that the windows api had to make exceptions for. These were filtered out via the api not by the file system. This also caused a lot of problems for the various windows UI tools like backup/restore. or when 3rd party tools were compiled and used from a interop client. Nothing like watching a person try to find out why they copy a file called con.txt from a unix client to a windows server and backup software stops working.

At least some of the windows api will tell you that you are using a reserved word. (from the days of DOS) the file system does not know of these old reserved words only some of the windows api. I just tried cmd.exe and tried to make con.txt (no file created) notepad indicated that you used a reserved word.
DOS limits.... so funny
 
Last edited:
Solution

Chaz-Dave

Distinguished
Jul 22, 2016
20
0
18,510
Thank you for your response (johnbl), and for not presuming that the question was based upon a false premise, as was indicated in some of the responses above.

I came across the following article
https://thegeekpage.com/fix-destination-path-too-long-error-in-windows-10/
which outlines the reg edit approach around the same time that you posted, but your link was the official link explaining this - much appreciated - implemented and corrected;)(y)