Fix: “File Path Is More Than 259 Characters” in OneDrive

Microsoft OneDrive logo

A customer at a financial services firm reported they could not open documents in a newly shared OneDrive folder. When they tried to open a Word file, they received an error saying the file path was more than 259 characters. The same issue prevented them from saving files to the folder. We found the folder structure was deeply nested with long descriptive names, pushing the total path over the Windows character limit. Moving the files to a shorter path fixed the issue immediately.

Symptoms

When trying to open, save, or sync files in OneDrive or SharePoint, you may see the following error message:

Cannot open the file because the file path is more than 259 characters. Try shortening the path or filename.

You may also experience:

  • Files failing to sync in the OneDrive desktop client
  • Unable to save documents from Word, Excel, or PowerPoint to certain folders
  • Files appearing in SharePoint Online but not accessible from the synced local folder
Microsoft Word error: Cannot open the file because the file path is more than 259 characters

Cause

Windows and most Microsoft Office applications enforce a 259/260 character limit on file paths. When files are synced via OneDrive, the full local path includes the OneDrive root folder (for example, C:UsersusernameOneDrive - Company Name) plus all subfolder names plus the filename itself.

Deeply nested folder structures with long descriptive names easily push the total path beyond this limit. This is especially common when businesses migrate to cloud storage and carry over complex folder hierarchies from file servers.

The Windows LongPathsEnabled registry setting does not help in this case. Office applications (Word, Excel, PowerPoint) do not support long paths, even when this setting is enabled.

Resolution

There are several approaches to fix this issue. You may need to use a combination depending on how deeply nested your folders are.

Option 1: Shorten Folder and File Names

The quickest fix is to rename folders and files to use shorter names. Focus on the deepest levels of nesting first, as those contribute the most to the total path length.

  1. Open SharePoint Online in your browser (not the local synced folder).
  2. Navigate to the folder structure causing the issue.
  3. Right-click on folders or files with long names and select Rename.
  4. Use abbreviations or shorter descriptions where possible.
  5. Wait for OneDrive to sync the changes to local devices.

Option 2: Reorganise the Folder Structure

If your folders are nested more than 3-4 levels deep, consider flattening the structure.

  1. Identify the folders with the deepest nesting.
  2. Move subfolders up to a higher level in the hierarchy where it makes sense.
  3. Combine folders that serve a similar purpose.
  4. Aim for no more than 3-4 levels of nesting in most cases.

Option 3: Shorten the OneDrive Root Folder Name

The OneDrive sync client creates a local folder named OneDrive - [Organisation Name]. If your organisation has a long name, this eats into the character budget before any subfolders are counted.

  1. Open the OneDrive settings (click the OneDrive icon in the system tray, then the gear icon).
  2. Go to Account and click Unlink this PC.
  3. Sign back in and during setup, choose a shorter folder path or rename the sync folder.
  4. Wait for the library to re-sync.

Note: This will require a full re-sync of your OneDrive files.

Option 4: Split Content Across Multiple SharePoint Sites

For organisations with very large document libraries, consider splitting content into separate SharePoint sites. Each site has its own document library with a fresh path, which effectively resets the folder depth.

  1. Create a new SharePoint site for a department or project.
  2. Move the relevant folders and files to the new site’s document library.
  3. Sync the new library separately via OneDrive.
  4. Update any shared links or bookmarks to point to the new location.

Important Notes

  • SharePoint Online URL limit: SharePoint Online has a total URL path limit of 400 characters (including the site URL, library name, folders, and filename). Even if you fix the local Windows path issue, extremely long paths can still cause problems in the browser.
  • LongPathsEnabled does not help: The Windows registry setting HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlFileSystemLongPathsEnabled only applies to applications that explicitly support it. Microsoft Office apps do not, so enabling this setting will not resolve the issue.
  • Check path length before migrating: If you are migrating files from a file server to SharePoint or OneDrive, audit your folder paths beforehand. Any path that is close to 200 characters on the file server is likely to exceed the limit once the OneDrive root folder is added.
  • OneDrive sync errors: Files that exceed the path limit may show sync errors in the OneDrive client. Check the OneDrive activity centre for a list of affected files.

If you need help with OneDrive or SharePoint file access issues, get in touch with our team.

Was this article helpful?
Ready to secure and simplify your IT? Talk to a GCIT expert today.