i tried all available solution but problem still presist
Long file path issues in Windows 11 Pro with Microsoft VS Code and File Explorer
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.
77 answers
Sort by: Oldest
-
Anonymous
2024-02-06T16:12:38+00:00 -
Les Ferch 10,361 Reputation points Volunteer Moderator
2024-02-06T16:27:13+00:00 i tried all available solution but problem still presist
Are you referring to a long path issue specific to VS Code or in Explorer in general?
-
Anonymous
2024-02-07T07:58:43+00:00 i tried all available solution but problem still presist
Are you referring to a long path issue specific to VS Code or in Explorer in general?
Problem with explorer in general
OS : Windows 11 Education (23H2)
-
Les Ferch 10,361 Reputation points Volunteer Moderator
2024-02-07T13:21:02+00:00 If you can navigate and edit long paths at a Cmd prompt, without having to use the *\?* prefix, then that means the LongPathsEnabled setting is working correctly.
However, Explorer (even the latest version in 23H2) does NOT support long paths, regardless of the LongPathsEnabled setting. You can navigate long paths with Explorer, but you cannot make any change that will extend the path.
For long path support, in a GUI file manager, you'll have to turn to third party solutions, such as XYPlorer.
Long path support in Explorer is long overdue.
Please upvote this feedback if you have a regular Windows account:
Please upvote this feedback if you have an Insider account: https://aka.ms/AAn2b02
-
Anonymous
2024-02-17T02:00:13+00:00 I found that I can paste files from the clipboard into deep folders in explorer. But, there's a limit how deep explorer can go.
While testing I found a limit at about 18K bytes. I made a deep folder 200 deep where each folder was 100 bytes. Once you get to about 18,195 bytes in, Explorer refuses to enter that folder. I tried right clicking on the folder and selected "copy as path" here's what I got:
"\?\D:\longpath\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o1234_ThisIs100bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o1234_ThisIs200bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o1234_ThisIs300bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o1234_ThisIs400bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o1234_ThisIs500bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o1234_ThisIs600bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o1234_ThisIs700bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o1234_ThisIs800bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o1234_ThisIs900bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs1000bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs1100bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs1200bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs1300bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs1400bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs1500bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs1600bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs1700bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs1800bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs1900bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs2000bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs2100bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs2200bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs2300bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs2400bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs2500bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs2600bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs2700bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs2800bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs2900bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs3000bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs3100bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs3200bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs3300bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs3400bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs3500bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs3600bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs3700bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs3800bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs3900bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs4000bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs4100bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs4200bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs4300bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs4400bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs4500bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs4600bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs4700bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs4800bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs4900bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs5000bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs5100bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs5200bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs5300bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs5400bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs5500bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs5600bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs5700bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs5800bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs5900bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs6000bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs6100bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs6200bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs6300bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs6400bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs6500bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs6600bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs6700bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs6800bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs6900bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs7000bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs7100bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs7200bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs7300bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs7400bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs7500bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs7600bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs7700bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs7800bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs7900bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs8000bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs8100bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs8200bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs8300bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs8400bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs8500bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs8600bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs8700bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs8800bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs8900bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs9000bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs9100bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs9200bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs9300bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs9400bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs9500bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs9600bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs9700bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs9800bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123_ThisIs9900bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs10000bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs10200bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs10300bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs10400bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs10500bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs10600bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs10700bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs10800bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs10900bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs11000bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs11100bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs11200bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs11300bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs11400bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs11500bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs11600bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs11700bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs11800bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs11900bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs12000bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs12100bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs12200bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs12300bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs12400bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs12500bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs12600bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs12700bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs12800bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs12900bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs13000bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs13100bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs13200bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs13300bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs13400bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs13500bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs13600bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs13700bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs13800bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs13900bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs14000bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs14100bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs14200bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs14300bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs14400bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs14500bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs14600bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs14700bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs14800bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs14900bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs15000bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs15100bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs15200bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs15300bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs15400bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs15500bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs15600bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs15700bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs15800bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs15900bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs16000bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs16100bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs16200bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs16300bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs16400bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs16500bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs16600bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs16700bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs16800bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs16900bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs17000bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs17100bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs17200bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs17300bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs17400bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs17500bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs17600bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs17700bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs17800bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs17900bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs18000bytes\o123456789o123456789o123456789o123456789o123456789o123456789o123456789o123456789o12_ThisIs18100bytes"
I'm surprised by the odd limit. UNC names are supposed to support up to 32K. I was making a test for my internal tool for deep file manipulation and couldn't navigate there via explorer. The other fun thing about using these deep folders is that you cannot specify these files, by name directly, on the command line because the command line buffer is limited to 8K. Needless to say, don't make paths more than 8K long unless you're writing custom software to deal with them.
Also, if you navigate that deep on the command line, you cannot run any EXEs from that deep because the current working folder needs to be much less than 8K. This might explain why explorer is has issues with long paths, since windows itself has issues with deep current working folders. It'll be interesting if they fix windows so explorer can do its job properly.