OneDrive Duplicating Files, Prevention & File Removal
When a file appears to have been updated on more than one PC, OneDrive may be unable to merge both versions. To help prevent the loss of data, OneDrive simply creates a new file with the computer name appended to the end of the file to distinguish which files have been changed and from which computer.
For example, if you have a laptop that isn’t connected to the internet and update the “OneDrive/MyFile.docx” file. Because the laptop isn’t online it cannot sync. But now you (or someone) also ends up updating the “OneDrive/MyFile.docx” file on an internet connected desktop PC. When your laptop goes back online, OneDrive will have a conflict because the file was updated on two different computers at seeming different times. As a result, OneDrive creates the conflict copy: “OneDrive/MyFile-LaptopName.docx“.
How to Remove Duplicate Files in OneDrive Folder
An ideal solution would be for Microsoft to provide us with a file conflict resolution feature within OneDrive which would list all of the files in conflict and allow us an easy way to select the proper file or merge the two. But that is just my opinion.
WinMerge
Right now, you can download WinMerge, a free and open source differencing and merging tool for Windows. WinMerge can compare both folders and files, presenting the differences in a visual text format that is easy to understand and handle. Note: Be sure to have a current working local backup of all your data prior to doing this, just in case!
CCleaner
CCleaner has an easy to use file Duplicate Finder feature. It is located under the Tools menu item, then Duplicate Finder. Using it should be self-explanatory but if not, visit their support forums. Note: Be sure to have a current working local backup of all your data prior to doing this, just in case!
Manual Duplicate File Removal
Assuming that all of the conflicting duplicated folders and documents are just that, duplicates. We can simply run a search query within Windows Explorer or via the web interface for OneDrive for the computer name (which is appended to the end of the filename). Once the search completes, I select all the discovered files and press the delete key. The files are then moved to my computers’ recycling bin. Note: Be sure to have a current working local backup of all your data prior to doing this, just in case!
Preventing Duplicate Files in OneDrive
If a file is duplicated within your OneDrive with your computer name appended to the end of the filename, it may be time to refresh your credentials.
To do this, click on the Windows “Start” button and type “credentials“. There may not be a place to type that in, but just start typing and one will automagically appear. Select Credentials Manager from the list of options.
Within the Credential Manger window, click on the Windows Credentials icon. Then under the Generic Credentials section, look for any entries containing “OneDrive Cached Credentials” and remove them. Once removed, restart OneDrive.
If, after restarting OneDrive, your issue does not resolve you may want to simply uninstall, reboot, then reinstall OneDrive. Note: You won’t lose files or data by uninstalling OneDrive on your computer. You can always access your files by signing in to OneDrive online. But locally backing up your data is your responsibility and always highly recommended. Personally, before I start any such troubleshooting tasks I always ensure that I have a current, working, local backup of all my data on my PC.
You may also want to set OneDrive to let YOU choose how to manage any OneDrive sync conflicts. To set this preference, visit the Microsoft OneDrive Settings, under the Office tab, make sure that “Let me choose to merge changes or keep both copies” is check rather than “Always keep both copies…” as seen in the OneDrive settings window screenshot below:
Conclusion
I welcome your thoughts, questions or suggestions on my article on how to prevent OneDrive from duplicating files and removing duplicate files from OneDrive.
You may support my work by sending me a tip using your Brave browser or by sending me a one time donation using your credit card.
Let me know if you found any errors within my article or if I may further assist you by answering any additional questions you may have.