84

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?

4
  • try the Build 14352 and set the GP entry Commented May 28, 2016 at 15:16
  • Either use the Group Policy setting or change the registry manually. See news.slashdot.org/story/16/05/31/0012222/…
    – holmb
    Commented May 31, 2016 at 8: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
    Commented Jul 26, 2017 at 3: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. Commented Jul 23, 2021 at 15:45

3 Answers 3

79

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:

enter image description here

enter image description here

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>
17
  • 5
    ask this Microsoft. We can't tell you why and how they made decisions about this issue. Commented Dec 30, 2014 at 7:17
  • 3
    They 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. Commented Jul 3, 2015 at 16:16
  • 3
    Microsoft 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
    Commented Nov 21, 2015 at 19:12
  • 7
    Yeah, I don't really care how they do it, but why are they still forcing us to respect MAX_PATH in 2015....
    – Ryan Mann
    Commented Dec 22, 2015 at 16:35
  • 6
    260 characters ought to be enough for anyone ;)
    – paulm
    Commented Sep 1, 2016 at 8:02
5

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
0
0

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.

1
  • 1
    subst is your friend
    – evandrix
    Commented Mar 17, 2020 at 7:38

Not the answer you're looking for? Browse other questions tagged or ask your own question.