The lazy programmer scripts
scripts that work

Lazy enable longer than 255 characters paths on Windows GitHub

On Windows 10 / Windows Server 2016 or newer, you can use longer than 255 characters paths if you set a simple registry key value.

This script needs to be run in PowerShell as Administrator.

Tested in Windows 10, Windows 2016, Windows 2019.

#ps1

$basePath = "HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem"
$keyName = "LongPathsEnabled"

# On Windows 10 or newer, it enables the posibility to use
# paths longer than 255 characters
Set-ItemProperty -Path $basePath -Name $keyName -Value 1

# Applications that use this feature need to be restarted

That's all, folks!

Written by kami on Tuesday December 18, 2018
Permalink - Tags: powershell, windows, filesystem

Leave a comment

comments powered by Disqus

« Lazy see git merge history - Lazy remove cached favicons in Chrome »