Enable Win32 long paths
Activer les noms de chemin d’accès Win32 longs
Explanation
Enabling Win32 long paths will allow manifested win32 applications and packaged Microsoft Store applications to access paths beyond the normal 260 character limit. Enabling this setting will cause the long paths to be accessible within the process.
L'activation des chemins longs Win32 permet aux applications win32 incluant un manifeste et aux applications Microsoft Store packagées d'accéder aux chemins au-delà de la limite normale de 260 caractères. En activant ce paramètre, les longs chemins seront accessibles au sein du processus.
Registry
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\FileSystem- Value name
LongPathsEnabled
| State | Value written |
|---|---|
| Enabled | REG_DWORD = 1 |
| Disabled | REG_DWORD = 0 |
PowerShell
PowerShell commands that write to the registry what the policy would write. Values in angle brackets (<…>) must be replaced.
Writing directly to the registry bypasses Group Policy: if a GPO manages this value, it will be rewritten at the next gpupdate; otherwise the value stays in place (the "tattooing" effect). Prefer a GPO or, locally, LGPO.exe. Run PowerShell as administrator for HKLM. Some policies need a restart or gpupdate /force.
Enable
# Enable: FileSys/LongPathsEnabled
$k = 'HKLM:\System\CurrentControlSet\Control\FileSystem'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'LongPathsEnabled' -Value 1 -Type DWordDisable
# Disable: FileSys/LongPathsEnabled
$k = 'HKLM:\System\CurrentControlSet\Control\FileSystem'
if (-not (Test-Path -Path $k)) { New-Item -Path $k -Force | Out-Null }
Set-ItemProperty -Path $k -Name 'LongPathsEnabled' -Value 0 -Type DWordRevert to "Not configured"
# Revert to "Not configured": FileSys/LongPathsEnabled
$k = 'HKLM:\System\CurrentControlSet\Control\FileSystem'
Remove-ItemProperty -Path $k -Name 'LongPathsEnabled' -ErrorAction SilentlyContinue