Path too long error in Windows ============================== Author: Momchil Ivanov Date : 2017.10.13 Introduction ------------ Windows has a default path name length limit of 256 characters. Nested folders can, however have longer paths. Trying to remove files or directories which have path names longer than the limit can be a problem. Increasing the limit -------------------- Windows 10 has a registry setting to enable path names longer than this limit. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem Dword (32-bit): LongPathsEnabled = 1 Removing files -------------- One way to circumvent the path name limit when deleting files is using robocopy. In order to do this one creates an empty folder and uses robocopy to synchronise it with the folder in questing using the /purge flag which removes all files an directories that do not exist in the empty folder. $ mkdir empty $ robocopy empy my-folder /purge