|

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

StepWhat to doWhere
1Remove the saved Microsoft account entriesCredential Manager > Windows Credentials > Generic Credentials
2Or delete the sign-in settings file%localappdata%\Microsoft\OneDrive\settings
3Restart OneDriveStart menu, search for OneDrive
4If copies keep appearing, uninstall and reinstall OneDriveSettings > 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.

SymptomExample
Duplicate file with the computer name addedbook1.xlsx and book1-desktop-computer.xlsx
Sign-in trouble with expired credentialsOneDrive 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

  1. Select Start and type credentials.
  2. Open Credential Manager.
  3. Select the Windows Credentials tab.
  4. Under Generic Credentials, remove any entry that contains MicrosoftAccount and your username.
  5. 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

  1. Press Windows + R to open the Run dialog.
  2. Enter %localappdata%\Microsoft\OneDrive\settings and select OK.
  3. Delete the file named PreSignInSettingsConfig.json.
  4. 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.

  1. Select the OneDrive cloud icon in the notification area.
  2. Select the Help and Settings icon, then Settings.
  3. Open the Account tab.
  4. Select Unlink this PC, then Unlink account.
  5. Delete PreSignInSettingsConfig.json as in Method 2.
  6. Sign in again when OneDrive prompts you.
  7. 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

  1. Open Settings and go to your list of installed apps.
  2. Find Microsoft OneDrive, select the more options icon and select Uninstall.
  3. 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.

  1. Open Spotlight, search for keychain and open Keychain Access, or find it in the Utilities folder.
  2. Search for OneDrive.
  3. Delete the entry named OneDrive Cached Credential.
  4. 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.

CauseWhat OneDrive does
File name, folder name or full path too longShortens 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 periodMay rename the file
Saving to personal OneDrive from Word, Excel or PowerPointCan 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 typeWhat Microsoft says happens in a conflict
Non-Office filesOneDrive 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 filesYou 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.

RuleWhat 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 filesAny file name starting with ~$
Largest file for sync250 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.

Official sources

Leave a Reply

Your email address will not be published. Required fields are marked *