About this article: This article is reviewed against the cited sources. This is source research, not lab validation. Check the stated versions and your own requirements before making changes.
When OneDrive reports that a path is too long, Microsoft's fix page says it pauses that one item and keeps everything else syncing (its path-limits page says the sync client quits until the item is resolved), and OneDrive offers two buttons in the Activity Center: Shorten path and Move file (or Move folder). The path is the whole address: every folder name plus the file name, added together. Shorten a name or move the item up the folder tree, and the item syncs again without losing content.
Names have a second set of rules. Some characters and some names are not allowed at all in OneDrive and SharePoint, and they stop an item syncing in the same way. Microsoft lists them, and the lists are quoted below.
What the error means
Microsoft's "What are the file path length limits?" page gives a different limit for each place a file lives:
| Where | Limit | What Microsoft's page says |
|---|---|---|
| Office desktop apps on Windows (Word, PowerPoint, Excel) | 256 characters (260 UTF16 WCHARs) | Can't open files whose full path exceeds 260 characters, even if the file is stored locally |
| Windows File Explorer | 260 characters | Applies to opening, renaming and moving; names up to 255 characters; File Explorer doesn't use the long-path Group Policy setting |
| OneDrive and SharePoint (cloud) | 400 characters | The entire decoded file path, including the file name |
| OneDrive sync | 520 characters | Local path (up to 400) plus the OneDrive root folder (up to 120); more shows a sync error |
The local path starts with the sync folder on the PC. For a work or school account that folder is named after the organisation, for example OneDrive - Contoso, so those users "have fewer characters available for their file and folder names". A file created in the browser can sit inside the 400-character cloud limit and still be too long once it syncs to a PC.
Microsoft's page also says special characters, spaces and accented characters are URL-encoded in SharePoint (a space becomes %20) and that the encoded forms count toward the 400-character limit. A path that looks short in the browser can therefore use more characters than it appears to.
The same page says that when the Windows long-path Group Policy setting is on, each application must still opt in. "File Explorer and Office desktop apps don't currently opt in, so enabling the policy alone doesn't change the 260-character limit for most users." Turning that policy on is not a fix for a path error in File Explorer or Office.
Likely causes
| Cause | What you see | How to confirm |
|---|---|---|
| Full local path over 260 characters | Office desktop app won't open the file; File Explorer won't rename it | Count the characters of the full path (command below) |
| Local path over 520 characters | A "path is too long" notification. Microsoft's path-limits page says the sync client quits until the item is resolved; its fix page says only that item is paused and everything else keeps syncing | The OneDrive icon and Activity Center list the item |
| A name over 255 characters made in the browser | Folder exists on the web, not in File Explorer or Finder | Check the name length on the web |
| An invalid character in a name | The item will not sync | Compare the name against the character list below |
| A reserved or blocked name | The item will not sync | Compare the name against the name list below |
| Office lock file pushes the path over | Errors on save or open when the path is close to 260 | Microsoft's page says Office adds ~$ lock files by appending characters to the path |
| A shortcut to a shared library | Long paths appear only on the PC | Check the nesting of the shared library |
Prove the cause before changing anything
All of these are read-only. In the OneDrive Activity Center (select the cloud icon in the taskbar), the paused item is listed with a note that its path is too long, with the two buttons. Microsoft's fix page says the Shorten window shows how far over you are, for example "Path is 32 characters too long."
To count one path in PowerShell, Microsoft's page gives this form (replace the path with your own):
("C:\Users\JaneDoe\OneDrive - Contoso\Projects\2026\Q1\Budget_Report_v3.xlsx").Length
To list every file in a folder tree whose path is over 260 characters, Microsoft's page gives:
Get-ChildItem -Path "C:\Users\JaneDoe\OneDrive - Contoso" -Recurse | Where-Object { $_.FullName.Length -gt 260 } | Select-Object FullName, @{Name="PathLength";Expression={$_.FullName.Length}} | fl
Both only read. The second walks the whole tree, so run it on one project folder first.
Next, check the name against Microsoft's list. These characters are not allowed in file and folder names in OneDrive for home or OneDrive for work or school: " * : < > ? / \ |. Leading and trailing spaces are not allowed either. These names are not allowed for files or folders: .lock, CON, PRN, AUX, NUL, COM0 to COM9, LPT0 to LPT9, _vti_, desktop.ini, and any name starting with ~$. _vti_ cannot appear anywhere in a file name, and a folder name cannot start with either ゛ or ဧ.
The same page says some organisations do not yet support # and % in names, and that a global admin or SharePoint admin can allow them (the SharePoint blog it links explains how). It also says that, for Office desktop apps on Windows, an Office file cannot be saved through the Backstage view to a OneDrive or SharePoint folder whose name contains a semicolon.
Example (illustrative): at contoso.com.au, Priya's work-account sync folder is C:\Users\priya.nair\OneDrive - Contoso, which is 38 characters. Synced to her PC, the full local path is 266 characters, which is 6 over 260. Word will not open it. Renaming the file and shortening two folder names brings the local path under 260 characters.
Fix
Choose between the two ways Microsoft documents: shorten the path by renaming, or move the item to a folder with fewer levels above it.
If the item sits in a shortcut to a shared folder, Microsoft's page says that fixing the path "changes the item for everyone who uses that folder, not just you", and tells you to check with the folder owner if you are not sure. Do that before either step below.
Shorten the path by renaming
Before you rename it, copy the current full path into a text file. A path over 260 characters may not open in File Explorer, so write the folder and file names down from the Shorten this path window, which shows the full path as a list of folders, or read the path from the breadcrumb trail in the OneDrive web app. That line is what the back-out puts back. For the example it is:
C:\Users\priya.nair\OneDrive - Contoso\Projects\2026\Q1\Client Work Contoso Pty Ltd\Deliverables for Board Pack\Final Approved Versions\Quarterly Business Update Meeting Notes - January 2026 (approved by the board with finance committee comments) and risk notes.docx
Risk: the next steps rename a synced file, or a folder that contains synced files, in the OneDrive library. Microsoft's page says renaming a folder "renames it everywhere in your OneDrive, just like renaming it in File Explorer", so every link, script or shortcut that names the old path stops matching.
- In the OneDrive Activity Center, find the item and select Shorten path.
- In the Shorten this path window, select the file or a folder in the list and type a shorter name. The message at the bottom updates as you type.
- When it reads "Path is short enough to sync", select Save changes.
To undo it: rename the item back to the name you saved, in the OneDrive web app, or on the PC with the command below. Microsoft's page says a name that is too long for File Explorer can be renamed on the OneDrive or SharePoint website. Repeat for each name you changed. The item will be paused again, because the old path is too long.
Rename-Item -Path "<full path as it is now>" -NewName "<old name only>"
Move the item instead
Before you move it, copy the current full path of the item into a text file, as above.
Risk: the next steps move a synced file or folder to a different place in OneDrive. Anything that points to the old location, including shared links to a folder, scripts and a colleague's shortcut, no longer finds it there.
- In the Activity Center, select Move file (or Move folder).
- In the File Explorer window that opens, browse to a folder with fewer folders above it and select Select folder.
- If asked to confirm, select Move file (or Move folder).
To undo it: move the item back to the folder you saved in the text file, in File Explorer or the OneDrive web app.
Rename an invalid name
Before you rename it, copy the old name into your text file.
Risk: the next step renames a file or folder in a synced library, so anything that refers to the old name stops matching it.
Rename the file or folder so that it avoids the characters and names listed above. Microsoft's page says to select it and press F2 in Windows, or Return on a Mac. The same page carries a note, "January 28, 2025: OneDrive for Mac now supports invalid characters."
The old name cannot be put back, because OneDrive does not accept it. The copy in your text file is the record of what it was.
Confirm the fix
- The item disappears from the Activity Center list.
- Re-run the character-count command on the new path. It should be 260 or under for Office on Windows.
- Open the file in the Office desktop app. If it opens, the local limit is met.
What to watch afterwards
- New folders created in the browser inside deeply nested libraries. Microsoft's page says migrations from other cloud storage can combine folder structures past the limits.
- Shortcuts to shared SharePoint or Teams folders. Microsoft's page says the local path can pass 260 characters even when the browser works fine, and suggests syncing only a subfolder or asking the library owner to flatten the structure.
- Long organisation names. Microsoft's page says IT admins can shorten the OneDrive sync folder name with the "Set a custom name for the OneDrive folder" Group Policy.
- The Office lock-file case, where a path close to 260 characters fails only on save.
Read next
Related articles you may want next.
- TroubleshootingOneDrive for Business can't sync after a tenant migration, UPN change or password updateOneDrive for Business stuck after a tenant migration, UPN change or password update? Sign out, clear OneAuth and IdentityCache, sign in. Safe steps.Read article
- Backup & RecoveryWhat a Windows file copy can miss: alternate data streams, links, placeholders and long pathsHow alternate data streams, reparse points, hard links, cloud placeholders and long paths affect Windows file-level backup and restore.Read article
- HostingHosted file storage: a file server VM, SharePoint/OneDrive or the office NASHow a business decides where shared files live after moving its applications to a hosting provider: a file server alongside the hosted servers, SharePoint and OneDrive, or the existing office NAS, using Microsoft's documented sync limits and an inventory of how files are used.Read article
Risks and limits
These commands have not been run or lab-tested.
Microsoft's pages give limits that hold today and can change; check the current page before you quote a number to a customer. Microsoft's pages cover OneDrive and SharePoint sync from Windows and Mac; they do not set limits for a file server, and for third-party apps Microsoft says "Varies". One message that mentions another program, "The action can't be completed because the folder or a file in it is open in another program", is described by Microsoft as sometimes meaning a path is too long, so it is not proof of a path fault. Renaming and moving change what everyone sees, so tell the owners of shared folders first.
Sources
- Restrictions and limitations in OneDrive and SharePoint — Microsoft Support, date not shown, accessed 22 November 2026
- What are the file path length limits? — Microsoft Support, date not shown, accessed 22 November 2026
- Fix paths that are too long to sync in OneDrive — Microsoft Support, date not shown, accessed 22 November 2026
- Rename-Item — Microsoft Learn, date not shown, accessed 22 November 2026
This article was originally published on .