How To Fix OneDrive Duplicate Files With Computer Name (2026)
OneDrive has made a second copy of a file and added your computer name to the end of the file name.
Microsoft links this to sign-in credentials that have expired on the PC.
This guide shows the Microsoft fixes for Windows in order, from the simplest to a reinstall.
Quick answer: clear the saved OneDrive credentials
| Step | What to do | Where |
|---|---|---|
| 1 | Remove the saved Microsoft account entries | Credential Manager > Windows Credentials > Generic Credentials |
| 2 | Or delete the sign-in settings file | %localappdata%\Microsoft\OneDrive\settings |
| 3 | Restart OneDrive | Start menu, search for OneDrive |
| 4 | If copies keep appearing, uninstall and reinstall OneDrive | Settings > Apps |
What the duplicate looks like
Microsoft gives the example of a workbook named book1.xlsx and a second file named book1-desktop-computer.xlsx next to it.
The same Microsoft article lists trouble signing in to OneDrive with credentials that have expired on the computer as the other symptom.
| Symptom | Example |
|---|---|
| Duplicate file with the computer name added | book1.xlsx and book1-desktop-computer.xlsx |
| Sign-in trouble with expired credentials | OneDrive asks you to sign in again or will not sign in |
Why it happens
Microsoft’s article on duplicate files says the cause is outdated saved credentials on the PC.
That is why the fixes below clear the credentials instead of deleting the extra files.
Method 1: Remove the entries in Credential Manager
- Select Start and type credentials.
- Open Credential Manager.
- Select the Windows Credentials tab.
- Under Generic Credentials, remove any entry that contains MicrosoftAccount and your username.
- Restart OneDrive.
Microsoft’s page does not list other entries to remove, so leave the rest alone.
Method 2: Delete the sign-in settings file
- Press Windows + R to open the Run dialog.
- Enter
%localappdata%\Microsoft\OneDrive\settingsand select OK. - Delete the file named
PreSignInSettingsConfig.json. - Open OneDrive from the Start menu and sign in again.
Microsoft documents this route on a separate page about clearing cached credentials.
Method 3: Unlink and relink your PC
Microsoft’s unlink and relink page also tells you to delete PreSignInSettingsConfig.json to clear sign-in credentials.
- Select the OneDrive cloud icon in the notification area.
- Select the Help and Settings icon, then Settings.
- Open the Account tab.
- Select Unlink this PC, then Unlink account.
- Delete
PreSignInSettingsConfig.jsonas in Method 2. - Sign in again when OneDrive prompts you.
- If OneDrive says the folder already exists, select Use this folder.
Microsoft says no data is lost, because the folders are only disconnected from the cloud for a short time.
OneDrive then syncs your files back and downloads placeholders by default, so it can take a while.
If duplicates keep appearing: reinstall OneDrive
- Open Settings and go to your list of installed apps.
- Find Microsoft OneDrive, select the more options icon and select Uninstall.
- Download OneDrive again from Microsoft and install it.
Microsoft says uninstalling OneDrive does not delete your files, and you can still reach them at OneDrive.com.
The same fix on a Mac
Microsoft’s duplicate-files page gives these steps for macOS.
- Open Spotlight, search for keychain and open Keychain Access, or find it in the Utilities folder.
- Search for OneDrive.
- Delete the entry named OneDrive Cached Credential.
- Run OneDrive again.
If copies still appear, uninstall and reinstall OneDrive, as on Windows.
If OneDrive renamed the file instead
A different Microsoft page explains why OneDrive can change a file name, and that has nothing to do with the computer name.
| Cause | What OneDrive does |
|---|---|
| File name, folder name or full path too long | Shortens the path and the start of the file name, for example to 1_holiday_picture.jpg |
| Unsupported characters such as ” * : < > ? / \ | | Replaces each invalid character with an underscore |
| Name starts or ends with a space, or ends with a period | May rename the file |
| Saving to personal OneDrive from Word, Excel or PowerPoint | Can rename the file, for example # becomes ^N |
Microsoft says the file contents are not changed.
If OneDrive offers a Rename button in the notification, select it.
To rename by hand, select the file in File Explorer and press F2.
Renamed files can lose their sharing, so rename the file and share it again.
Conflict copies on a work or school account
Duplicates with a device name can also be a sync conflict, which Microsoft describes in its troubleshooting article for OneDrive for work or school.
| File type | What Microsoft says happens in a conflict |
|---|---|
| Non-Office files | OneDrive keeps both versions, the online one keeps the original name and the local copy gets your device name added, such as Report-JOHNS-SURFACE.txt |
| Office files | You resolve it in the Office app with Save a Copy or Discard |
For non-Office files, Microsoft says OneDrive for work or school creates up to 5 conflict versions.
You can compare and merge the versions, rename them or keep both.
For a conflict, Save a Copy saves your version outside the synced folder and Discard drops your changes and fetches the server version.
Names and sizes OneDrive will not accept
Check a file against these rules if it will not sync.
| Rule | What Microsoft lists |
|---|---|
| Invalid characters | " * : < > ? / \ |, and no leading or trailing spaces |
| Reserved names | .lock, CON, PRN, AUX, NUL, COM0 to COM9, LPT0 to LPT9, desktop.ini, _vti_ anywhere in a name |
| Temporary Office files | Any file name starting with ~$ |
| Largest file for sync | 250 GB per file |
Microsoft’s page does not give a number for the longest file name or path, and says limits differ between apps and Office versions.
After the fix: check the copies
Open both copies of an affected file and compare them before you remove one.
If you delete the wrong copy by mistake, our guide to restoring deleted files in OneDrive shows how to get it back.
If OneDrive also shows a sync error, see what the OneDrive icons mean and how to fix OneDrive stuck on Processing changes.