Categories
Uncategorized

How to bypass windows max path length in 260 characters?

In windows maximal length of path is defined by MAX_PATH, which is y default has value 260.
But from another side many win32 api can operate with path length up to 32,767 characters.
Starting from Win 10, Windows api does not depend on MAX_PATH value.
To enable it user should change registry.
The registry key Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled (Type: REG_DWORD) must exist and be set to 1.
To enable it using Powershell, please run Powershell as Administrator and run following command:
New-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" -Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force

Leave a Reply