OneDrive · Sync Error Fix

Fix OneDrive "Path Too Long" Sync Errors on Windows 10 & 11

May 8, 2026 · Long Path File Editor Team · 7 min read

OneDrive refuses to sync a file and the error reads "we can't sync this item because the path is too long" — or some variation. The cause is the same one Windows has had for decades: a file path over 260 characters. This guide covers four ways to fix it, ordered from quickest to most thorough, so you can pick the right one based on how many files are affected.

In this guide
  1. Why OneDrive throws "path too long" errors
  2. The exact error messages OneDrive shows
  3. Method 1: Move your OneDrive folder closer to the drive root
  4. Method 2: Enable Win32 long paths in Windows
  5. Method 3: Rename problem files and folders manually
  6. Method 4: Bulk-shorten paths with LPFE (fastest at scale)
  7. Method comparison at a glance
  8. FAQ

Why OneDrive throws "path too long" errors

OneDrive doesn't introduce a new path length limit — it inherits whichever is stricter between Windows and the OneDrive backend. There are three layers in play:

1

Windows MAX_PATH (260 characters) — the legacy limit on the full absolute path of any file. By default Windows enforces this for all standard file operations, which means OneDrive can't even read a file whose path is over the limit.

2

OneDrive's local sync engine — independently rejects any item it considers too deep, even if Windows long paths are enabled. This is a sync-layer check, not a Windows-API check.

3

OneDrive for Business / SharePoint backend (400 characters) — the URL limit applied server-side once a file uploads. A file fine under the local 260-char limit can still be rejected at the cloud if the resulting URL — including the tenant prefix — exceeds 400 characters.

The default OneDrive folder path doesn't help: C:\Users\YourName\OneDrive\ is already 25-plus characters before any of your files exist. Add a synced SharePoint library, then a few nested project folders with descriptive names, and you cross 260 fast.

The exact error messages OneDrive shows

If you see any of these, you're hitting the same root cause:

"We can't sync this item because the path is too long"

"OneDrive can't sync this file. The path is too long. Try moving the file closer to the root of your OneDrive."

"Sync error: file or folder name is too long"

"Path too long: this item could not be synced"

"The file name(s) would be too long for the destination folder" (when copying into a OneDrive-synced folder)

OneDrive's recommended fix in its own dialog — "move the file closer to the root" — works for one or two files but doesn't scale. The four methods below do.

Method 1: Move your OneDrive folder closer to the drive root

Method 01
◆ Easy · No admin · ~5 min

Relocate OneDrive from the user profile to a shorter root

By default, OneDrive lives at C:\Users\YourName\OneDrive\. Moving it to C:\OneDrive\ shaves about 20 characters off every path inside — often enough to clear all but the worst offenders.

1

Right-click the OneDrive cloud icon in the system tray and choose Settings.

2

Open the Account tab and click Unlink this PC. Confirm. Local files stay in place.

3

Sign back in. When OneDrive prompts for a folder location, click Change location and choose a short path like C:\OneDrive\.

4

Wait for OneDrive to re-index. Files that previously failed often start syncing automatically.

Watch for: the new folder must not already exist with content, and you'll need enough free space for OneDrive to verify each file before it considers the location healthy.

Method 2: Enable Win32 long paths in Windows

Method 02
⚠ Admin required · Partial fix only

Set the LongPathsEnabled registry key

Windows 10 (1607+) and Windows 11 ship with a setting that lets the Windows API handle paths up to 32,767 characters. Turning it on helps Windows-aware applications reach files past the 260 limit — useful when you need to access the file to fix it, even if OneDrive itself still won't sync it.

1

Press Win + R, type regedit, press Enter.

2

Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem.

3

Find LongPathsEnabled, double-click, change the value from 0 to 1, click OK.

4

Restart Windows for the change to take effect.

Important: this does not fix OneDrive directly. OneDrive enforces its own path-length checks at the sync layer, independent of the Windows API. Enabling long paths makes it easier for tools like LPFE, Explorer, and PowerShell to reach the affected files so you can rename them — but it won't make OneDrive itself accept a 270-character path.

Method 3: Rename problem files and folders manually

Method 03
◆ No admin · Slow at scale

Use OneDrive's sync activity panel to find and shorten

For a handful of problem paths, the most direct fix is to find each one and rename it down. OneDrive surfaces the offenders in its sync activity panel, so you don't have to search blindly.

1

Click the OneDrive cloud icon, then View sync problems. Each entry lists the file path and the reason.

2

For each item, identify the shallowest folder you can rename to gain the most characters back. Renaming a parent shortens every child path inside it simultaneously.

3

Rename in Explorer using shorter, descriptive names. Aim to drop the total path well under 260 characters — leave some headroom for files that may move or be added later.

4

Wait for OneDrive to retry the sync. Items typically clear within a minute of the rename.

Limitation: manual renames are practical for 5 or 10 paths. Past that — especially on synced SharePoint libraries with hundreds of historical paths — you need bulk tooling.

Method 4: Bulk-shorten paths with LPFE

Method 04
✓ No admin · Fastest at scale · Full preview

Scan and rename your entire OneDrive folder in one pass

Long Path File Editor (LPFE) was built specifically for this scenario. Point it at your OneDrive folder, let it scan recursively, and apply rule-based renames across every offender — with a live before-and-after preview before any change touches the disk.

1

Add your OneDrive folder. Click "Add Folder" and select your OneDrive root (C:\Users\You\OneDrive\ or wherever you've placed it). LPFE walks the entire tree and flags every path over 260 characters.

2

Set rules. Toggle "Remove Spaces," "Remove Brackets," or load a Find/Replace text file to swap long phrases (e.g. "Department of Justice" → "DOJ") across every path automatically.

3

Preview. The "Proposed Path" column updates live as you adjust rules — confirm each rename before anything is committed.

4

Commit. LPFE renames shallowest-first (parent folders before children, automatically) and writes a CSV log of every change. Undo is available if anything looks wrong.

5

Let OneDrive resume. Once the renames are done, OneDrive picks up the new paths and starts syncing. The path-too-long errors clear themselves.

Tip: pause OneDrive sync (cloud icon → "Pause syncing") before running LPFE on a large batch. This prevents OneDrive from trying to re-sync files mid-rename, which can produce duplicate sync errors that resolve themselves but look noisy.

Try LPFE free — no credit card needed

Free trial includes all 9 rules, capped at 25 entries. Full version is $49 one-time — no subscription, ever.

Download Free →

Method comparison at a glance

Method Fixes existing paths? Admin required? Works at scale? Best for
Move OneDrive folder Indirect — shortens roots No Partial Quick win for any user
Registry / Group Policy No Yes Partial Helping Windows reach affected files
Manual rename Yes No No — very slow 1–10 problem files
LPFE bulk rename Yes No Yes — full OneDrive folder Hundreds of files, SharePoint libraries, IT cleanup

Frequently asked questions

What is the OneDrive path length limit?

OneDrive personal respects the Windows 260-character limit. OneDrive for Business — backed by SharePoint — enforces a 400-character total URL limit and a 256-character per-segment limit. A path that's fine locally can still be rejected on upload to OneDrive for Business if the resulting SharePoint URL exceeds 400 characters once the tenant URL prefix is added.

Why does enabling Windows long paths not fix OneDrive sync errors?

The Windows LongPathsEnabled setting only changes how Windows-aware applications can read and write files locally. OneDrive enforces its own checks at the sync layer and on the server side. Long paths in Windows make the affected files reachable so you can rename them — but they don't make OneDrive itself accept paths over its limits.

How do I find which OneDrive files have paths that are too long?

The fastest path: right-click the OneDrive cloud icon, open Settings, and review the sync activity panel — every flagged item lists the file path and the reason. For a complete inventory across the entire OneDrive folder, point LPFE at the OneDrive root and let it scan. It lists every path over 260 characters in one pass and lets you rename them in bulk.

Can I move my OneDrive folder after it's already set up?

Yes. Right-click the OneDrive cloud icon, open Settings, go to the Account tab, and click Unlink this PC. Then sign in again and choose a shorter folder location during setup — for example, C:\OneDrive\ instead of the default location under your user profile. Files re-sync automatically once the new location is set.

Does the path-too-long error also affect OneDrive for Business?

Yes, and the limits are stricter. OneDrive for Business is backed by SharePoint, which enforces a 400-character total URL limit and a 256-character per-segment limit. A path that fits comfortably under the Windows 260-character limit can still be rejected on upload because the resulting SharePoint URL exceeds 400 characters once the tenant URL prefix is added.

Will LPFE break OneDrive's version history if it renames synced files?

OneDrive treats a rename as a move within the same library, so version history is preserved on the renamed item. Only the path changes — the file content, modified date, and version stack stay attached. As with any bulk operation on synced data, pausing OneDrive sync during the rename and verifying a small batch first is a reasonable precaution.