I am unable to install TensorFlow due to this.
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: Most helpful
-
Anonymous
2023-03-21T03:59:46+00:00 -
Anonymous
2023-03-20T17:38:30+00:00 I have excel from office 2021 and it is not long path aware nor long path enabled. So, it cannot "see" long path named files. You'll see this same issue in Windows 10 too. Make a super deep path and try saving a file there via Excel's "save as" dialog box. It won't let you due to the long paths not being supported in excel. Easiest way to make a deep folder is from the command line. Have ChatGPT write you a script to do that.
Microsoft have enabled support for long path names. But, each application has to "opt in" for long path name support. I wrote my own application and it works like a champ with long path names. But, I'm still very disappointed that even though the path name can be 32K bytes, it has a basic limitation that each element is limited to 256 bytes. That means each folder name is limited to 256 bytes and each filename can only have 256 bytes. So, to get a 32K full path filename, it has to be over 100 folders deep - which is crazy deep.
Seems to me that Microsoft does the minimum long path name support - it's almost as if they just want that check box on the feature list. Same deal with the registry entry for enabling case sensitive filenames - I tried that once: it breaks everything.
To sum up: Long path names only work for applications that have been ported to the correct APIs. Most applications have not been ported.
-
Anonymous
2023-03-20T17:14:29+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.
Microsoft closed their ticket on this. The long 32K paths work for me on win11 except for ISE PowerShell. What issue are you seeing?
I also have this issue.
Noticed that GPEDIT solution does change Registry.
The registry and GPEDIT in my Windows 11 Pro - 10.0.22621 Build 22621 version are set accordingly to allow for long paths.
However I can't open an MS Excel file synched SP site documentation through Windows Explorer.
Aso, opening MS Excel and trying to open the file through the dialog: does not work.
Always: path loo long.
-
Deleted
This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.
Comments have been turned off. Learn more
-
Anonymous
2023-02-12T03:07:25+00:00 Thanks very much! I ran the long.bat successfully but after that I still can't rename the files.
My system information: Windows 11 pro, version 22H2 x64