OneDrive stops with a red cross and `0x8007007B: The filename, directory name, or volume label syntax is incorrect.` Everything else syncs fine; one item refuses. This is OneDrive's name filter doing its job: some names that your PC happily stores cannot live in the cloud, and until you rename them, the queue stays stuck behind that one file.
Quick steps
- Open the OneDrive activity center to find the flagged file
- Remove forbidden characters: \ / : * ? " < > |
- Rename reserved names like CON, AUX, NUL, COM1
- Trim trailing spaces and periods from names
- Shorten paths longer than 400 characters
- Reset OneDrive if valid names still refuse to sync
Things you'll need
- The OneDrive sync error notification
- Access to the files inside your OneDrive folder
- PowerShell for batch renames, if many files are affected
- Fifteen minutes for the renames to upload and clear the queue
Step-by-step
Method 1 of 3: Find the Name OneDrive Is Rejecting
Download image
Step 1: Read the Flagged Item in the Activity Center
Click the OneDrive cloud icon in the system tray and open the sync errors view. It lists the file or folder that failed, with its full path. That one entry is the whole problem — everything behind it in the queue is waiting for it to be renamed. Write the name down exactly as shown, including any trailing spaces.
Download image
Step 2: Check for Forbidden Characters
Windows Explorer tolerates names OneDrive does not. Scan the flagged name for `\ / : * ? " < > |` — the most common offender is a colon in something like `Meeting: notes.docx`, which Windows allows locally but OneDrive rejects. Remove or replace the character with a dash, and watch the sync icon turn green.
Download image
Step 3: Look for a Reserved Windows Name
Names like `CON`, `PRN`, `AUX`, `NUL`, `COM1` through `COM9`, and `LPT1` through `LPT9` are reserved by Windows itself. A file called `CON.xlsx` or a folder called `AUX` cannot sync. Rename it to something descriptive — `conference.xlsx` instead of `CON.xlsx` — and the error clears immediately.
Download image
Step 4: Trim Trailing Spaces and Periods
A name ending in a space or a period — `report .docx` or `Archive.` — is a name the cloud cannot address, even though your PC displays it fine. Rename the file and delete the trailing character. In Explorer you may not see the space at all; in a terminal, run `dir /x` in that folder to see the raw names and spot it.
Download image
Step 5: Measure the Full Path Length
OneDrive rejects paths longer than about 400 characters, counting the whole nested folder chain. Paste the full path into a text editor and count. If it is over the limit, shorten folder names near the top of the tree — every character removed at the top shortens every path beneath it.
Method 2 of 3: Rename and Unblock the Queue
Download image
Step 6: Rename the Flagged Item
Right-click the flagged file and rename it to something plain: letters, numbers, dashes, and a normal extension. No trailing spaces, no symbols from the forbidden list. Within a minute OneDrive picks the file up again, and the red cross turns into the syncing arrows and then the green checkmark.
Download image
Step 7: Batch-Rename With PowerShell for Many Files
When dozens of files carry the same bad character, rename them in one pass: `Get-ChildItem "C:\Users\you\OneDrive\Reports" -Recurse | Rename-Item -NewName { $_.Name -replace ':', '-' }`. Adjust the folder and the character. Run it once, wait for the sync to process the changes, and confirm the error list empties.
Download image
Step 8: Fix Names That Collide After Renaming
Renaming two files to the same name — stripping different symbols from `Report: A.docx` and `Report A.docx` — creates a duplicate OneDrive refuses for a different reason. Add a date or a number to one of them so both are unique and legal. Check the activity center afterwards to confirm both uploaded.
Download image
Step 9: Move Deep Files Upward in the Tree
For a file that is legal but buried past the path limit, drag it a few folders up and rename the deep folders shorter. The upload retires once the full path fits. Restructure the tree afterwards if you need the depth — shorter names at the top keep everything underneath under the limit.
Download image
Step 10: Watch the Queue Clear
After the renames, watch the OneDrive icon cycle through syncing back to the green checkmark, and reopen the activity center. The error list should empty as the renamed files upload. Anything still flagged is a second offender — rename it the same way and the queue finishes.
Method 3 of 3: Reset Sync When Names Are Not the Problem
Download image
Step 11: Unlink and Reconnect OneDrive
If every name is legal and the error persists, the sync database itself is stale. Open OneDrive settings, go to Account, and choose `Unlink this PC`. Sign back in and point it at your existing OneDrive folder. It re-scans everything fresh, which clears phantom errors attached to files that no longer exist.
Download image
Step 12: Exclude Stubborn Folders With Selective Sync
For a folder you cannot rename — a project archive, a client's files — exclude it instead of fighting it: in OneDrive settings under Account, click `Choose folders` and untick it. The folder stays on the PC but leaves the sync queue, and 0x8007007B stops appearing. Rename a copy later if you want it in the cloud.
Download image
Step 13: Check the Local Drive for Errors
A drive losing its file table reports names incorrectly to OneDrive, which rejects them as invalid. Run `chkdsk C: /f` in an elevated terminal and let it repair. On the drive holding your OneDrive folder, a clean file table means the names OneDrive reads are the names that are really there.
Download image
Step 14: Update OneDrive to the Current Version
An outdated sync client mis-parses names the current version handles fine. Check for updates under OneDrive settings > About, or download the current client from Microsoft and install it over the top. After the update, re-run the sync and watch whether the flagged list shrinks.
Download image
Step 15: Test With a Fresh OneDrive Folder Location
As a final check, unlink and reconnect OneDrive but point it at a new empty folder instead of the existing one. Let it download everything from the cloud. If the error never appears in the fresh folder, the old folder's local names were the whole problem — keep the new location and delete the old one after confirming everything downloaded.
Tips
- 0x8007007B is always one name. Fix it and everything queued behind it syncs at once.
- The colon is the most common offender — Windows allows it in display, OneDrive does not. Replace it with a dash.
- dir /x shows the raw short names and exposes trailing spaces Explorer hides.
- Selective sync is the escape hatch for folders you cannot rename — exclude them instead of fighting the error.
Warnings
- Batch-renaming with PowerShell rewrites many names at once. Test the command on a small folder first.
- Do not rename files inside the OneDrive folder while it is mid-sync of a large batch — pause syncing first to avoid collisions.
- Unlinking OneDrive does not delete your files, but confirm the folder contents before signing back in.
- Avoid renaming a file the error list has not flagged yet. Rename only flagged items, or you can create duplicate-name errors.
Frequently asked questions
Why does my PC allow the name but OneDrive rejects it?
Windows stores the name on your disk with rules OneDrive's cloud does not share. Colons, trailing spaces, and reserved names like CON work locally and fail in the cloud. OneDrive's sync error is the message that one name cannot make the trip.
Will renaming the file break my shortcuts or links?
Local shortcuts pointing at the old name break, and shared OneDrive links change. Update them after the rename. The file's contents are untouched — only the address changes.
The error says the name is invalid but I cannot see anything wrong with it.
It is almost always a trailing space or period that Explorer does not display. Run dir /x in a terminal inside that folder — the raw listing shows the invisible character. Rename and remove it.
Can I sync files with those characters if I zip them first?
Yes — an archive's name is what syncs, and the names inside it do not matter to OneDrive. For files you cannot rename, zip the folder, sync the archive, and the error is gone. Unzip at the other end to get the original names back.
References
- Microsoft Learn — System Error Codes 0–499 (0x8007007B, ERROR_INVALID_NAME). https://learn.microsoft.com/en-us/windows/win32/debug/system-error-codes--0-499-
- Microsoft Support — Restrictions and limitations in OneDrive and SharePoint. https://support.microsoft.com/en-us/office/restrictions-and-limitations-in-onedrive-and-sharepoint-64883a5d-228e-48f5-b3d2-eb39e07636fa
- Microsoft Support — Save disk space with OneDrive Files On-Demand. https://support.microsoft.com/en-us/office/save-disk-space-with-onedrive-files-on-demand-0e6860d3-d9f3-4971-b321-7092438fb38e
- Microsoft Learn — Naming files, paths, and namespaces. https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file
- Microsoft Learn — chkdsk command reference. https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/chkdsk
Every guide is reviewed against its sources. See our editorial policy.
Reader comments
0 so farFinished this guide? Tell other readers what worked, what didn't, and what you would change.