Can someone please tell us/me if the MAX_PATH issue still exists in (the technical preview of) Windows 10. And if it exists: How many characters can a path and an individual file name have?
-
12Please leave a comment when you down vote. E.g. some URL where the answer could easily be found. Or whats wrong with the question itself. – dkeck Dec 28 '14 at 21:37
-
try the Build 14352 and set the GP entry – magicandre1981 May 28 '16 at 15:16
-
Either use the Group Policy setting or change the registry manually. See https://news.slashdot.org/story/16/05/31/0012222/microsoft-removes-260-character-path-length-limit-in-windows-10-redstone – holmb May 31 '16 at 08:02
-
I've recently seen this mentioned when I installed Python, as they have an option after installing to disable the `MAX_PATH` limit. Why would someone end up with a path name longer than 260 characters? – Ungeheuer Jul 26 '17 at 03:18
-
@Ungeheuer this can happen when you are serializing data from an application onto the filesystem to share with other developers. Many content serializers will follow a path structure when creating these folders and files, especially in regards to a CMS tree of pages and data items. – Ben Sewards Jul 23 '21 at 15:45
3 Answers
The issue will be always present in Windows, to keep compatibility with old software. Use the NT-style name syntax "\\?\D:\very long path"
to workaround this issue.
Starting with Windows 10 (Version 1607 - Anniversary Update) and Windows Server 2016 you have an option to ignore the MAX_PATH
issue by overriding a group policy entry enable NTFS long paths
under Computer Configuration
-> Admin Templates
-> System
-> FileSystem
:
The applications must have an entry longPathAware
similar to DPIAware in the application manifest.
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" >
<asmv3:application>
<asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
<longPathAware>true</longPathAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>

- 27,895
- 5
- 86
- 127
-
19Why didn't Linux or Mac face these compatibility problems? Why can't the non-Unicode Win32 file API be extended (with some conditions in the existing IO handling functions) to be able to use e.g. MAX_PATH2 = 4096 (or clever dynamic allocation). The old software will then only use the legacy part of the implementation. But the new software especially Microsoft products (including cmd, explorer, powershell, VS) should make use of the new features. The OS should shadow all this technical-history: "Simply use dev:\path\file.ext and me the OS will decide whats the best choice." – dkeck Dec 29 '14 at 22:51
-
5ask this Microsoft. We can't tell you why and how they made decisions about this issue. – magicandre1981 Dec 30 '14 at 07:17
-
3They were debating hardcore about fixing it for win10 and just breaking compatibility finally. I'm not sure where they landed on the issue, but they're really thinking about it. – justin.m.chase Jul 03 '15 at 16:16
-
@justin.m.chase they could add a new entry to the manifest file, which developers can set if their application works fine with longer paths. Old software or tools without the entry would still use the old length. – magicandre1981 Jul 03 '15 at 17:49
-
2maybe not a relevant comment, but my opinion is that these sorts of things will continue to push devs away from Windows; command line tools are better on linux and linux doesn't have these limitations that are "broken - won't fix" – jcollum Aug 10 '15 at 19:31
-
3Microsoft should just give us the option to turn it off in the registry to the max NT supports "32,000" something... And let us worry about what software we use and whether it will break or not... Using node.js on windows is frustrating as hell... To the point that I make linux vm's just to do node work... Yet microsoft totes windows as being this awesome development environment... Sometimes I can't even structure my .Net code the way I want because namespaces get long and I have to rename folders differently than there namespace... – Ryan Mann Nov 21 '15 at 19:12
-
2@Ryios no, general registry options are bad. I think the setting in the application manifest would be the best way. – magicandre1981 Dec 22 '15 at 16:33
-
7Yeah, I don't really care how they do it, but why are they still forcing us to respect MAX_PATH in 2015.... – Ryan Mann Dec 22 '15 at 16:35
-
2@justin.m.chase looks like MS followed my advice and added my app manifest setting based solution in Win10 Version 1607 - Anniversary Update. – magicandre1981 May 28 '16 at 07:31
-
@Ryios try the latest insider build, it seams to fix the limitation – magicandre1981 May 28 '16 at 15:16
-
1Note that UWP apps will also be opted-in to long paths if they have Max Version Tested >= Windows Anniversary. They don't need the Fusion manifest entry. But the GP still needs to be flipped before *any* app can use long paths – Peter Torr - MSFT Jun 02 '16 at 02:14
-
3They probably should have done this the same way they did at Vista. Always enable it, gets lots of programs to crash on the stack buffer overflow without any diagnostic whatsoever and make everybody exclaim "anniversaries suck!". But programmers will fix their bugs and the next release will be "great". This is not a complete answer without mentioning the /GS consequences. – Hans Passant Aug 13 '16 at 09:17
-
6
-
Finally, using One Commander helped me copy the files. Details at http://superuser.com/a/1135038/139067 – gsinha Oct 14 '16 at 21:25
-
2Even with Anniversary Update and long file paths turned on, Windows 10 still cannot de-compress a heavy zip file without moaning about this. It is beyond ridiculous in the 21st century. – Andrew S Oct 27 '16 at 03:09
-
8@AndrewS the Explorer is not longpath aware yet. they still work on it – magicandre1981 Oct 27 '16 at 04:05
-
@AndrewS no, with 1607 they added the basics to kill max path and maybe with version 1703 they made Explorer compatible – magicandre1981 Oct 28 '16 at 03:59
-
-
1for the [reason why](http://stackoverflow.com/q/1880321/995714). Probably it's just for a program to allocate a fixed buffer to receive paths from Windows, and in the DOS 8.3 era, 260 characters is really long – phuclv Apr 12 '17 at 17:09
-
Here's some ansible code to enable long paths to avoid all that clicking in @magicandre1981 answer. This was tested on Windows Server 2016, it should work on Windows 10 too.
- name: Remove filesystem path length limitations
win_regedit:
path: HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem
name: LongPathsEnabled
type: dword
data: 1
state: present

- 11,189
- 37
- 48
Yes it does still exist. Just ran into an issue now and the usual method of mapping a network drive to it to shorten the path didn't seem to let me open the files, but it would let me rename and move them.

- 399
- 4
- 14