Long file path issues in Windows 11 Pro with Microsoft VS Code and File Explorer

Anonymous
2022-05-04T22:27:47+00:00

I spent way too long debugging a compile error in MS VS Code (64bit version 1.66.2). It would fail with 'file not found' or 'unable to access file' errors. The workspace is located in "C:\Users\UserName\Documents\My Workspaces\firmware", with several levels of nested source folders below.

Initially, I got several linking errors due to Controlled Folder Access protection using the Ransomware protection built-in to Windows Security. I whitelisted ar.exe and as. exe, but the errors persisted. I even turned off Ransomware protection. Seeing a thread online about long file paths reminded me I hadn't enabled that on Windows 11 yet (fresh install), so I changed the following settings and rebooted the PC:
Registry: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled set to 1.

Group Policy: System "Configuration>Administrative Templates>System>Filesystem>Enable Win32 long paths" enabled.

About that time I noticed an issue with not being able to delete or rename files on an SMB share that were in a deep path. If I went to the other system and moved them up a few folders I was again able to rename the files.

Both of these scenarios work fine from my Windows 10 Pro PC. My Windows 11 Pro PC is a fresh install (Version 21H2 Build 22000.613).

So I believe Windows 11 isn't respecting my Long Paths settings. As a final test, I moved my VS Code Workspace folder to system drive root (C:\firmware) and it compiled without error.

I've seen other questions on here about Windows 11 path length issues that were brushed away because they were encountered using non-Microsoft 3rd Party software, but this is all built-in File Explorer and Microsoft's own VS Code product.

My question is, how do I actually allow long file paths in Windows 11 Pro?

Windows for home | Windows 11 | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

77 answers

Sort by: Newest
  1. Les Ferch 10,361 Reputation points Volunteer Moderator
    2023-11-19T16:18:28+00:00

    That will make no difference.

    Application manifests are for developers to set certain options for their applications at compile time. They can't be used to change the capabilities of an exe afterwards. Only Microsoft can add long path support to Explorer and they haven't done that yet.

    Explorer only supports navigating long paths. Currently, you have to turn to third parties to get a file manager with full long path support. One such option is Directory Opus.

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2023-11-19T16:10:35+00:00

    Pardon me

    I have do an error with the content of xml file

    the correct is this

    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">

    <asmv3:application>

      &lt;asmv3:windowsSettings xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings"&gt;
    
         &lt;ws2:longPathAware&gt;true&lt;/ws2:longPathAware&gt;
    
      &lt;/asmv3windowsSettings&gt;
    

    </asmv3:application>

    </assembly>

    Thanks

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2023-11-19T15:59:04+00:00

    Hello Vousdoo,

    could you be clearer on how to write the .XML file and how to make explorer.exe read it?

    If I create the explorer.xml file like this

    <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">

    &lt;compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1"&gt; 
    
        &lt;application&gt; 
    
            &lt;!-- Windows 10, version 1903 --&gt; 
    
            &lt;maxversiontested Id="10.0.18362.1"/&gt; 
    
            &lt;supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" /&gt; 
    
        &lt;/application&gt; 
    
    &lt;/compatibility&gt; 
    

    </assembly>

    Is this correct or are there errors?

    Then, I copy it into the c:\windows folder where explorer.exe is.

    What else do I have to do to make it work?

    I thank you very much for your help

    ******@gmail.com

    Was this answer helpful?

    0 comments No comments
  4. Les Ferch 10,361 Reputation points Volunteer Moderator
    2023-10-11T03:36:53+00:00

    and File Explorer could navigate, add, delete, etc past the 300 character mark.

    File Explorer in Windows 10 and Windows 11 has always been able to navigate a long path, regardless of the LongPathsEnabled setting. But, AFAIK, it has never been able to edit a long path.

    Just to confirm, I ran a test on 23H2 Build 22631.2361.

    With LongPathsEnabled set to 0 I get an error (as expected) when trying to CD to a path that exceeds 260 characters:

    With LongPathsEnabled set to 1 I am able to CD to the bottom of the long path (it's greater than 600 characters). This proves that my LongPathsEnabled setting is valid and effective for applications, such as Cmd, that support it.

    Now let's try File Explorer...

    I can navigate a long path:

    But if I try to create a folder at the end of that long path, I will always get this error:

    But you stated that Explorer, on your computer, can be used to add or delete a long path. Can you please check that again by trying the same test I did? That is, try to create a folder at the bottom of the long path folder tree.

    Thanks.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  5. Anonymous
    2023-10-10T15:48:28+00:00

    My update on this:

    -Windows 11 Enterprise

    -Version 22H2

    -OS Build 22621.2134

    All of the suggestions listed in this thread failed to support LongPaths, including those from Andy Milne2. The suggestion about leaving LongPathsEnabled in Registry alone and setting it in GPEDIT got me down the right path, but ultimately I had to do the following:

    1. Ensure Enable Win32 long paths in GPEDIT is set to Not Configured.
    2. Delete the LongPathsEnabled key from registry. Sign out/sign on or reboot.
    3. Enable Wind32 long paths in GPEDIT. Sign out/sign on or reboot.
    4. Recreate LongPathsEnabled key in registry and manually set to 1. Sign out/sign on or reboot.

    Only after that process did the BAT script example previously shown in these comments work for me and File Explorer could navigate, add, delete, etc past the 300 character mark.

    md o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o1234_ThisIs100bytes

    cd o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o1234_ThisIs100bytes

    md o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o1234_ThisIs200bytes

    cd o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o1234_ThisIs200bytes

    md o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o1234_ThisIs300bytes

    cd o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o1234_ThisIs300bytes

    md o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o1234_ThisIs400bytes

    cd o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o1234_ThisIs400bytes

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments