Access is denied on long file paths

i’m getting Access is denied errors on the So side and appears to be due to long file paths. Not permissions as if I edit the path to shorter folder names, the number of access denied errors also reduces.

Is this a known issue / limitation as I couldn’t find anything specific doing a search?

Windows, v1.12.1-rc.1

When you try to report errors, please, include the actual full error, otherwise it’s not clear what are we talking about.

Access denied on what operation? If you included an error, perhaps it had the details.



there’s 258 characters in the path before the filename!! Due to the commercial nature of the content I have to hide the folder names

Max path on windows is 260… I thought that was just before file name though.

Nope I was wrong, the 260 char limit includes file names, this is a windows limitation.

My quick google suggests a registry setting could change it but I don’t know if it affects Syncthing’s interaction with the API

Syncthing uses long file name APIs and happily accepts paths longer than 260 characters. I think your problem is something else. Hovering on the error or looking in the log gives you lore details on the error.

(You’re on Windows so I would traditionally suspect your antivirus.)

The log line from the console would have more details as to which operation failed.

The logs only echo the error. It gives the file path and then :Access is denied.

So this with the error…


I change the URL and make a mapped drive, so the path is shorter…


This is a server, so only the built in AV

Maybe the long file name api doesn’t kick in with UNC paths…

1 Like

I can live with a mapped drive as a work around

@terry Out of interest, is HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem\LongPathsEnabled set to true on your system? Does it make a difference?

Assuming it isn’t locked by a group policy on your system of course.

I added the key, restarted the file server, set St to UNC and rescanned. No difference, still showing errors. so I will return it back to a mapped drive


1 Like

Just curious, but what happens if you add \\?\ to the path directly, e.g.



Also, another workaround could to be map those network paths as symlinks, e.g.

mklink /d "C:\Company_Files" "\\fileserver\e$\Company_Files"

and then use C:\Company_Files in Syncthing.

I was trying to avoid using a permanent link in case a worm got into the server. St is on a physical host, however the fileserver is virtual. Hence wanting to use an administrative share within St.

I can have a word with the end users and ask if they keep the paths a little shorter. I have already edited down the paths as much as I can as they appear to like to use sentences to say whats in the folder.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.