A Microsoft file hosting and synchronization service.
Hi Louis Heath
You can use the PowerShell script below to identify files whose full path exceeds 350 characters. Running this script with administrator permissions will generate a list of file paths that are approaching OneDrive's 400-character path length limit.
Get-ChildItem -Path "C:\Your\Source\Folder" -Recurse -ErrorAction SilentlyContinue |
Where-Object { $_.FullName.Length -gt 350 } |
Select-Object FullName, @{Name="Length";Expression={$_.FullName.Length}} |
Export-Csv -Path "C:\TooLongPaths.csv" -NoTypeInformation
Please note that the 400-character limit includes both the complete folder path and the file name. As a result, even when the file name itself is relatively short, a deeply nested folder structure can cause the total path length to exceed the limit.
With that in mind, you may want to move the affected folders closer to the root directory or shorten folder and file names where possible.
For more information, please refer to: Restrictions and limitations in OneDrive and SharePoint | Microsoft Support
After adjusting the file path length, please try uploading or syncing the files again to see whether the sync completes successfully.
I hope this provides some additional insight. If you have any updates, please feel free to share them.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.