0

I've encountered a recurring issue with my Windows servers (both 2016 and 2019) crashing, and I've noticed that backups using BackupPC sometimes fail. Upon investigation, I discovered that the problem always stems from file paths exceeding 255 characters. Despite repeatedly advising my users to utilize shorter names and paths, they have not complied, leading to frustration as resolving this requires deleting the offending file and restarting the server, causing significant disruptions.

In search of a solution, I've explored alternative methods that allow users to bypass this limitation. For instance, when saving files through Firefox, the path characters are not counted, and certain third-party tools can extract files from deeply nested directories even with lengthy paths which makes the server crash.

I am seeking advice on implementing a technical restriction to prevent users from creating paths exceeding 255 characters. While educating users is the ideal approach, their reluctance necessitates a technical solution. Any suggestions would be greatly appreciated. Thank you.

Teddy
  • 13
  • 2

2 Answers2

2

There is a Generell Aproach:

The Registry way

  • Please be aware that this could be harmful.

    • As it violates the Standards for Windows limitations.

using Regedit to edit

  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem
  • and add/change LongPathsEnabled to Hexadezimal 1

Lazy Admins using Powershell: *

New-ItemProperty -Path HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem" ` 
-Name "LongPathsEnabled" -Value 1 -PropertyType DWORD -Force

Using this, after a restart, it will enable Windows 10, 1607+ to use extended pathes at all. Thats meaned as a Workaround for your issue imho.

Native Dos

  • There is also in case of you need to delete an extend path a other solution
    • subst
subst /?
Assigns a drive letter to a path.

SUBST [Drive1: [Drive2:]Path] SUBST Drive1: /D

Drive1: Drive letter to assign to the path. [Drive2:]Path Physical drive and physical path to assign to the virtual drive. /D Deletes the association for (virtual) Drive1.

SUBST without parameters displays the virtual drives created with SUBST.

That means you can reduce the path by around at least 250 characters, which, based on my knowledge of the past two decades and beyond, is almost sufficient.

Notice to BackupPC

BackupPC has its last release 2020

Consider to change to a well known business Product like Veeam.
Veeam has a Community edition free of charge.

References:
HowToGeek
Microsoft
BackupPC

djdomi
  • 2,287
0

you can utilize Group Policy to enforce path length limitations. By configuring the "Enable Win32 long paths" policy under Computer Configuration > Administrative Templates > System > Filesystem, you can enforce a maximum path length of 255 characters. Additionally, implementing file system auditing can help track and identify violations of path length restrictions:

  1. Security Settings > Advanced Audit Policy Configuration > Object Access
  2. Audit File System >> Succes and Failure
Turdie
  • 2,945