SOLVED

Finding files with long paths that crash OneDrive

Copper Contributor

Hi All,

 

We have experienced an occasional problem where our users save files into a deep folder structure in their locally stored OneDrive and the file path is too long for OneDrive in the cloud.

 

Occasionally, the user will get an error message to say that OneDrive can't sync files, but sometimes OneDrive client just repeatedly crashes with no warning. Last time round I was lucky, in that I decided to copy off the user's entire local OneDrive to a shared network area before wiping her laptop and couldn't because of long file paths. This was how I worked out the problem.

 

However, I have what looks like this problem again, but am having trouble finding the file(s) with the long file path. The user has over 50Gb of files and its taking ages to copy off the data in an attempt to find which file won't copy due to the long file path.

 

Is there a clever way of finding the file path that works on the C: drive but doesn't work in our OneDrive could storage area?

 

Thanks,

 

Tim

3 Replies
best response confirmed by TimButterworth (Copper Contributor)
Solution

You can certainly generate a recursive list of files via PowerShell, even include a "path length" calculated property if needed. I'm sure there are sample scripts available online, look them up. If you cannot find anything, I'll circle back and post an example once I'm in front of a real PC.

@TimButterworth  This is why I built the Path Too Long Auto Fixer - is the 1st tool that discovers, reports and auto corrects filenames and paths that are too long to fit under the MAXPATH 260 character limit.

This issue still exists and it has a lot of impact.

 

A college renamed a Word document to its entire first paragraph. What it silly, but this impacted the OneDrives of the entire team:

- OneDrives of team members started to exit without notification. Occasionally a "path too long" flashed by.

- OneDrives of team members lost track of synchronisation targets. Not just synchronisation status, but targets. On restarting, Onedrive began to do full downloads, upto several hundreds of thousands (indeed, 1E+5 .. 1E+6) of files.

1 best response

Accepted Solutions
best response confirmed by TimButterworth (Copper Contributor)
Solution

You can certainly generate a recursive list of files via PowerShell, even include a "path length" calculated property if needed. I'm sure there are sample scripts available online, look them up. If you cannot find anything, I'll circle back and post an example once I'm in front of a real PC.

View solution in original post