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: Most helpful
  1. Anonymous
    2023-05-25T15:01:31+00:00

    Hi all
    I did all of this - simply type GPEDIT in the box and run "Edit group policy" For me, on windows 11 pro, ver22H2, OS build 22621.1702 just so ya know I'm current.

    My job is pretty stupid and simple - we have archived a code base (1.6tb of files) and a lot of this is very deeply nested in paths that exceed 260 char limit for filenames. Programmers are smart but also when you hyper-organize into ridiculously deep files, it doesnt work on Windows :(

    So simply put - I try to drag it all from an external hard drive over to my PC - and it barfs on about 3700 files that have this issue. In spite of GPEDIT... and i also checked regedit, of course its the matching config, this was successfully saved etc. With this many files I'm not going to be able to manually figure it out... so instead i had to go relatively deep into the file structure and copy subfolders that contained the offending files... and then save it all non-nested, and then someone will have to recreate it later. I sure do love this sh*t :)

    and if you read the fine print "enabling win32 long paths will allowe manifested win32 applications... to access paths beyond the normal 260 character limit" what is a "manifested process" ?? seems that "copying files" or "making folders" or "viewing contents of these folders" is not something "manifested" ??

    But yes - IT JUST DOESNT WORK MICROSOFT. Especially for simple stuff needed by regular people like me, like copying files into regular directories. I'm not powershelling or making scripts or running cmd stuff for my daily normal life, no thanks. Please fix this its NOT working 5/25/23

    Image

    Was this answer helpful?

    6 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2023-02-23T10:05:16+00:00

    It is Feb 2023, and I am still facing this issue. I don't know why they are not providing any solution to this.

    Was this answer helpful?

    6 people found this answer helpful.
    0 comments No comments
  3. Anonymous
    2023-01-13T16:48:54+00:00

    I'm amazed this is broken, even on Windows 11 pro 22H2

    It worked fine on my last Windows 10 pro machine

    Setting with regedit: BROKEN

    Setting with group policy: BROKEN

    Setting with M365 configuration: BROKEN

    It should be on by default!

    And it should work...

    Was this answer helpful?

    5 people found this answer helpful.
    0 comments No comments
  4. Anonymous
    2022-12-15T09:00:49+00:00

    Don't suppose you've had any more word on this? It would be a lovely christmas present if they resolved it, or found a work around! It's causing me serious problems running terragrunt in powershell with multiple levels of nested folders and if there's not a resolution or workaround coming I may have to downgrade to windows 10 or switch to linux.

    Thanks for raising with and dealing with Microsoft for us!

    G

    Was this answer helpful?

    5 people found this answer helpful.
    0 comments No comments
  5. Anonymous
    2022-11-16T12:16:40+00:00

    And November 2022

    Was this answer helpful?

    5 people found this answer helpful.
    0 comments No comments