A “File name is too long” or “Path too long” OneDrive sync failure occurs when the total character count of a file’s path exceeds the maximum supported length of the operating system or the Microsoft 365 sync engine. When this threshold is crossed, OneDrive flags the item with a red sync badge, pauses uploads and downloads for the affected file, and prevents edits from reaching the cloud.
Fast Fix:
Shorten the file name or move the item to a top-level directory closer to the root OneDrive folder. Alternatively, rename parent folders to reduce the total path string length. Once the total path falls below 400 characters for OneDrive (or 260 characters for legacy Windows API calls), the sync client will automatically resume processing.
Diagnostic Snapshot
- Common Causes: Deeply nested subfolders, verbose file naming conventions, or long SharePoint document library titles concatenated with local root paths.
- Impact Level: Isolated to files and subfolders exceeding path limits; unrelated files continue syncing normally.
- Cloud Integrity: Safe. Files already stored in the cloud remain untouched, though local synchronization remains paused until the path string is shortened.
Why Path Length Failures Occur
The root cause of this error lies in how the operating system and Microsoft 365 calculate absolute file paths:
- The 400-Character OneDrive/SharePoint Limit: Microsoft 365 supports a maximum decoded path length of 400 characters. This calculation includes the tenant URL, library name, every folder and subfolder layer, the file name, and URI character encoding (such as
%20for spaces). - The Windows Win32
MAX_PATHLimitation (260 Characters): By default, standard Win32 file system APIs enforce a legacy 260-character limit (C:\Users\username\OneDrive - Tenant\Subfolder\file.docx). Even if the cloud supports up to 400 characters, local Windows applications may fail to open, rename, or hydrate the file. - Local Sync Root Prefixing: When a user syncs a SharePoint document library locally, OneDrive prefixes the full local disk path (e.g.,
C:\Users\JohnDoe\Contoso Enterprise Solutions\Marketing - Documents\) to the file’s relative cloud path, pushing previously compliant cloud files over the local character ceiling.
Step-by-Step Resolution Path
Follow these actions in order, moving from quick file-level adjustments to system-wide policy fixes.
1. Rename the Flagged File or Shorten Folder Names
The quickest way to clear the sync error is to reduce character count directly in File Explorer:
- Click the OneDrive cloud icon in the taskbar to inspect the error notification and view the exact blocked path.
- Open File Explorer and navigate to the flagged item.
- Right-click the file, select Rename, and assign a shorter, concise name.
- If the file name is already short, inspect the enclosing subfolder hierarchy. Shorten parent directory names where feasible (e.g., rename
2026_Quarterly_Financial_Review_Draftsto2026_Q_Fin_Drafts). - OneDrive will immediately clear the warning and upload the changes.
2. Relocate Files Closer to the Root Directory
When folder names cannot be changed due to team naming conventions:
- Move the affected files or subfolders up one or more levels in the directory tree.
- Moving items higher in the folder structure eliminates redundant path segments, instantly dropping the total character count below the 400-character ceiling.
3. Enable Long Paths in Windows (Win32 MAX_PATH Override)
If you are running Windows 10 or Windows 11 and local applications fail to interact with deeply nested files that already exist in the cloud, enable native Long Path support:
- Press
Windows Key + R, typeregedit, and press Enter. - Navigate to:Plaintext
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem - Locate the
LongPathsEnabledDWORD value. - Double-click
LongPathsEnabled, set its Value data to1, and click OK. - Restart your computer.
(Note: While enabling LongPathsEnabled resolves local Win32 260-character restrictions, the Microsoft 365 cloud limit of 400 total characters still applies.)
4. Clear Cached Sync Conflicts via Reset
If you have shortened the path string but the OneDrive client remains stuck with a persistent “Path too long” warning badge, reset the local client cache:
- Press
Windows Key + Rto open the Run dialog. - Enter the following reset command and press Enter:DOS
%localappdata%\Microsoft\OneDrive\onedrive.exe /reset - The system tray icon will disappear. Allow up to 2 minutes for OneDrive to restart. If it does not reappear automatically, run:DOS
%localappdata%\Microsoft\OneDrive\onedrive.exe
Escalation & Enterprise Admin Checks
- SharePoint Library Name Shortening: In organizational setups, deep folder hierarchies combined with long SharePoint site and library names frequently cause path overruns for end users. SharePoint site owners should streamline top-level library names to conserve character budget across synchronized endpoints.
- Group Policy / Intune Management: Enterprise administrators can deploy the
Enable Win32 long pathsadministrative template (Computer Configuration > Administrative Templates > System > Filesystem > Enable Win32 long paths) via Microsoft Intune or GPO to standardize long-path handling across managed devices.