How to overcome file length limitation

Shahir Yusoff 0 Reputation points
2025-02-07T08:10:33.9466667+00:00

Here's the situation,

We have users who have backed up their files in OneDrive/SharePoint and have synced the files to their PC and now are unable to open the files in File Explorer which I assume is caused by the 256 characters limitation in Windows.

These users have lots and lots of folder and sub-folders with very lengthy folder and file names and telling them to rename their files to make it shorter isn't practical hence I need suggestions what can be done to fix this.

The files can be opened via SharePoint online or MS Teams but not in File Explorer which the users wants to use. It makes them easier to access the files through File Explorer instead of the online page or MS Teams.

I've a another question too, does the 256 characters includes drive letter too?

OneDrive
OneDrive
A Microsoft file hosting and synchronization service.
1,300 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Emi Zhang-MSFT 27,641 Reputation points Microsoft Vendor
    2025-02-10T01:19:06.7266667+00:00

    Hi,

    The URL path length limit for OneDrive and SharePoint has been increased from 256 Unicode code units to 400. This means that the total length of the file path, including the protocol, server name, folder or file path, folder or file name, and parameters, cannot exceed 400 characters. But for Windows the default length limit are 260 characters. This could be that you can open via SharePoint online or MS Teams but not in File Explorer.

    I suggest you refer to this support article and if you're using Windows 10, version 1607, and later, you can enable long paths:

    https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=registry

    Hope the information is helpful.


    If the response is helpful, please click "Accept Answer" and upvote it.

    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.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.