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. Anonymous
    2022-12-22T14:07:47+00:00

    I can't get long paths to work even in my current version (installed December 14, 2022) of Windows 10 Professional. Any suggestions most appreciated.

    System info:

    Edition Windows 10 Pro

    Version 22H2

    Installed on ‎14-‎Dec-‎2022

    OS build 19045.2364

    Experience Windows Feature Experience Pack 120.2212.4190.0

    I have made the following changes and then rebooted:

    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.

    I still cannot, as a test, save a text file (i.e. with extension .txt) on C:/ with the following name (which has over 260 characters, since 10 repeats of the 26 character English alphabet plus separating dashes):

    abcdefghijklmnopqrstuvwxyz-abcdefghijklmnopqrstuvwxyz-abcdefghijklmnopqrstuvwxyz-abcdefghijklmnopqrstuvwxyz-abcdefghijklmnopqrstuvwxyz-abcdefghijklmnopqrstuvwxyz-abcdefghijklmnopqrstuvwxyz-abcdefghijklmnopqrstuvwxyz-abcdefghijklmnopqrstuvwxyz-abcdefghijklmnopqrstuvwxyz.txt

    Was this answer helpful?

    2 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2022-12-21T17:22:58+00:00

    Microsoft just responded to my Dec 16th email. I asked:

    I know you have plenty of other issues to look at. But, please give me some sort of idea  when you guys might try and reproduce this issue at your end?

    Or, maybe you have already attempted to reproduce the issue?

    Either way, I'd love to get some sort of insight into how many more weeks before we get confirmation?

    Their response, and I quote:

    Hello Andy,
     
    Please accept my sincere apology for delayed support on behalf of my team.
    I deeply regret for the inconvenience caused; we are currently experiencing very High Case Volume.

    The delay isn’t intentional, and we are known to provide timely assistance during normal business situation. We are taking right measures to overcome current situation by adding more trained resources and we should be able to provide you excellent support once again soon.

    Please allow me some time to gte back to you with more information.

    Was this answer helpful?

    3 people found this answer helpful.
    0 comments No comments
  3. Anonymous
    2022-12-20T16:48:24+00:00

    Trouble is that no one in this discussion can get long paths to work on windows 11. We can get it working great with windows 10, but no one here can get it working on Windows 11.

    If you do get it working, please let us know how.

    Was this answer helpful?

    3 people found this answer helpful.
    0 comments No comments
  4. Anonymous
    2022-12-20T10:19:39+00:00

    I have the same problem in windows 11 fully patched. I have just enabled long paths with gpedit.msc (the Local Group Policy Editor) and restarted my PC twice, and still long names are not enabled.

    Am I skipping some step in the process?

    Thanks for your support.

    Update: after enabling longpaths with gpedit, as described above (and double-checking the enablement setting was on), I have checked the registry and I was disappointed to see that the longpath parameter was still set to 0 there. I have then set the longpath registry parameter to 1 and restarted the PC. After that it seems that longpaths are enabled. It seems that there is a disconnection between gpedit and the registry. Hope this information can help the group here.

    Was this answer helpful?

    3 people found this answer helpful.
    0 comments No comments
  5. Anonymous
    2022-12-20T09:21:55+00:00

    This is actually outrageous. It's 20 friggin' 22 and they still have problems counting to 261.

    I'm also encountering the issue, using a C# app writing XML files in a VS debug session (e.g. paths here are fairly structured and on the long side).

    But even if I try to create that same file with File Explorer, it won't let me create the file. It just stops accepting characters at some point.

    I enabled the feature via GP editor. Checked RegEdit and value is also at 1.

    Just did a reboot & just got a major WinOS update --> No Dice.

    Was this answer helpful?

    4 people found this answer helpful.
    0 comments No comments