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-23T04:59:27+00:00

    The ticket was closed months ago. Clearly Microsoft has little interest in fully supporting long path names in the enterprise versions of windows, so I really doubt if they have any interest at all with the home version. But, what you really want is GPEDIT on Windows 11 Home, and if you search for that, you'll find the stuff below, from: https://answers.microsoft.com/en-us/windows/forum/all/how-to-enable-the-gpeditmsc-on-windows-10-and-11/dbc76919-f2b5-4dec-a2b7-bcf545c34d00#:~:text=The%20GPO%20editor%20is%20fully,the%20Pro%2FEnterprise%20editions.%22

    If it does what it says, it should allow you to enable long path names on Windows 11 Home edition:

    Ive recently had to search for this informtion and thought I would share the answer. Sorce - Enable Group Policy Editor (gpedit.msc) on Windows 10/11 Home Edition | Windows OS Hub (woshub.com) "It is likely that, according to the Microsoft logic, the home user doesn’t need to edit the local settings through the gpedit.msc GUI. Accordingly, users of the Windows 10 home editions have to make changes through the registry editor regedit.exe`, which is not so clear and more risky since it is possible to make a mistake and break the system.

    Fortunately, Windows 10 Home has the undocumented option to install the gpedit.msc editor from the Windows image packages and manifests repository (\Windows\servicing\packages).

    How to Enable the GPEdit.msc on Windows 10 and 11 Home?

    To install the Local Group Policy Editor in Windows 10 Home edition, open a command prompt as administrator and run two one-line commands in sequence:

    FOR %F IN ("%SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientTools-Package~*.mum") DO (DISM /Online /NoRestart /Add-Package:"%F")FOR %F IN ("%SystemRoot%\servicing\Packages\Microsoft-Windows-GroupPolicy-ClientExtensions-Package~*.mum") DO (DISM /Online /NoRestart /Add-Package:"%F") Also these commands can be used to install gpedit.msc console in Windows 11 Home. For convenience, you can save this code to a text file gpedit-install.bat and run it as administrator. Wait a while until DISM installs the packages from the Windows 10 component store.

    In my case, the ClientTools and ClientExtensions packages were installed in Windows 10 Home:

    Microsoft-Windows-GroupPolicy-ClientTools-Package~…~amd64~~….mum
    Microsoft-Windows-GroupPolicy-ClientTools-Package~…~amd64~en-US~….mum
    Microsoft-Windows-GroupPolicy-ClientExtensions-Package~…~amd64~~….mum
    Microsoft-Windows-GroupPolicy-ClientExtensions-Package~…~amd64~en-US~….mum
    

    Now try to run the gpedit.msc console. The Local Group Policy Editor interface should open (no reboot required). The GPO editor is fully functional even in the Home edition of Windows 10 or Windows 11, and contains all the necessary policy sections that are available in the Pro/Enterprise editions."

    Was this answer helpful?

    5 people found this answer helpful.
    0 comments No comments
  2. Anonymous
    2023-05-19T06:47:18+00:00

    The problem is still relevant

    Was this answer helpful?

    4 people found this answer helpful.
    0 comments No comments
  3. 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
  4. Anonymous
    2022-11-30T17:41:20+00:00

    Seems like this is taking forever. So, here's an update on what's going on:

    The first guy they assigned it to went on vacation. Yesterday the new guy left some voicemail to a wrong number. Turns out the wrong phone number is on the ticket (digits transposed).

    Hopefully I'll have something useful to report soon.

    Was this answer helpful?

    4 people found this answer helpful.
    0 comments No comments
  5. Anonymous
    2022-11-27T17:23:26+00:00

    FYI: I opened a support incident with Microsoft on this today. It will be interesting to see what they have to say about this.

    I'm interested in what they report back to you as well. It's definitely not working in Windows 11 22H2 Education 64-bit either and I don't understand why. I have the same setting enabled too, LongPathsEnabled, set to DWORD value of 1.

    Was this answer helpful?

    4 people found this answer helpful.
    0 comments No comments