r/PowerShell • u/cmhawke • Apr 22 '26
Path too long although LongPathsEnabled is already 1 and I rebooted
I've done this:
- Press Windows Key + R, type regedit, and hit Enter.
- Navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem.
- On the right side, find LongPathsEnabled.
- Double-click it and change the "Value data" from 0 to 1
It was already 1.
I also executed this via PowerShell as an admin:
`New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" ``
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force
This was the output:
LongPathsEnabled : 1
PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
PSChildName : FileSystem
PSDrive : HKLM
PSProvider : Microsoft.PowerShell.Core\Registry
After rebooting, I again checked LongPathsEnabled at FileSystem via regedit and it still says 1.
I retried copying/pasting the folder from the SSD to the root of my Windows account and still get errors for paths that are too long. The folder is an archive of app development files. The IDEs I used naturally resulted in these long paths; I didn't make them that long on purpose. Shortening all of the paths would be a lot of work, make things more confusing and may break things if I need the original paths intact at a future date for app development purposes. The workaround I've used for now is zip the root folder of the content on macOS (the zip can obviously be transported without issue), and I can unarchive it on macOS if I need something. The main issues with this are (1) inconvenience in restricting viewing/unarchiving to macOS, and (2) zip files can become corrupt (fortunately rarely, although I think I've encountered this at least once), which would destroy everything in it. Any other things to try to bypass max_path on Windows without much hassle?
View all comments
Show parent comment
4
u/roxalu Apr 22 '26
Microsoft describes that the activation of MAX_PATH allows application to explicitly opt-in using this feature. The detail, that is not mentioned on the page is, that Microsoft has decided to NOT activate this opt-in for the default Windows Explorer.