SOLVED

Finding files with long paths that crash OneDrive

%3CLINGO-SUB%20id%3D%22lingo-sub-1754266%22%20slang%3D%22en-US%22%3EFinding%20files%20with%20long%20paths%20that%20crash%20OneDrive%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1754266%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20All%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20have%20experienced%20an%20occasional%20problem%20where%20our%20users%20save%20files%20into%20a%20deep%20folder%20structure%20in%20their%20locally%20stored%20OneDrive%20and%20the%20file%20path%20is%20too%20long%20for%20OneDrive%20in%20the%20cloud.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EOccasionally%2C%20the%20user%20will%20get%20an%20error%20message%20to%20say%20that%20OneDrive%20can't%20sync%20files%2C%20but%20sometimes%20OneDrive%20client%20just%20repeatedly%20crashes%20with%20no%20warning.%20Last%20time%20round%20I%20was%20lucky%2C%20in%20that%20I%20decided%20to%20copy%20off%20the%20user's%20entire%20local%20OneDrive%20to%20a%20shared%20network%20area%20before%20wiping%20her%20laptop%20and%20couldn't%20because%20of%20long%20file%20paths.%20This%20was%20how%20I%20worked%20out%20the%20problem.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHowever%2C%20I%20have%20what%20looks%20like%20this%20problem%20again%2C%20but%20am%20having%20trouble%20finding%20the%20file(s)%20with%20the%20long%20file%20path.%20The%20user%20has%20over%2050Gb%20of%20files%20and%20its%20taking%20ages%20to%20copy%20off%20the%20data%20in%20an%20attempt%20to%20find%20which%20file%20won't%20copy%20due%20to%20the%20long%20file%20path.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20a%20clever%20way%20of%20finding%20the%20file%20path%20that%20works%20on%20the%20C%3A%20drive%20but%20doesn't%20work%20in%20our%20OneDrive%20could%20storage%20area%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThanks%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ETim%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1754266%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EOneDrive%20for%20Business%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3ESync%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1754409%22%20slang%3D%22en-US%22%3ERe%3A%20Finding%20files%20with%20long%20paths%20that%20crash%20OneDrive%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1754409%22%20slang%3D%22en-US%22%3E%3CP%3EYou%20can%20certainly%20generate%20a%20recursive%20list%20of%20files%20via%20PowerShell%2C%20even%20include%20a%20%22path%20length%22%20calculated%20property%20if%20needed.%20I'm%20sure%20there%20are%20sample%20scripts%20available%20online%2C%20look%20them%20up.%20If%20you%20cannot%20find%20anything%2C%20I'll%20circle%20back%20and%20post%20an%20example%20once%20I'm%20in%20front%20of%20a%20real%20PC.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New 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

1 Reply
Highlighted
Best Response confirmed by TimButterworth (New 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.