How can I remove duplicate files (with -Machinename appended) created by OneDrive

DIck Lane live 0 Reputation points
2025-01-15T22:12:08.9333333+00:00

How can I remove duplicate files created by OneDrive (duplicates have -Machinename appended to their name)

I have a Windows 11 laptop, with Microsoft 365 installed, and an older PC running Windows 10. I had OneDrive running on both machines, storing a lot of my files: 180,220.315MB 81,965 files, 4,648 folders at 30 Dec 2024.

I decided to install Microsoft 365 on my PC, and to clean it up did a Reinstall of Windows 10, and then installed Microsoft 365 over 3 and 4 Jan 2025. After some difficulties, especially with Outlook, all seemed to be running OK.

BUT about 8 Jan I noticed a lot of files on OneDrive were duplicated with -PCNAME added to the file name, and the same size, and modified time. It looks as if this only happened for a short time- the newest -PCNAME file I see is 4 Jan 21:31

I tried the steps set out in https://support.microsoft.com/en-us/topic/duplicate-files-in-onedrive-fd47ce5e-8dd0-465e-9e3a-461e1a3cf613

I did all the steps, including Uninstall and reinstall OneDrive.

Although OneDrive now seems to be running OK, the duplicate files are still there both on my machines, and online.

TreeSize now shows 188,973.494MB 88,271 files, 4,715 folders

OneDrive has grown by over 8GB, 6000 files, 65 folders - I think these are all duplicate files.

How can I remove these please?

OneDrive
OneDrive
A Microsoft file hosting and synchronization service.
1,281 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Emi Zhang-MSFT 27,396 Reputation points Microsoft Vendor
    2025-01-16T08:56:26.2866667+00:00

    Hi,

    I suggest you try to remove the -PCNAME OneDrive account from the registry:

    NOTE: Serious problems might occur if you modify the registry incorrectly. Before you modify it, please remember to back up the registry for restoration in case problems occur.

    Here is an article about how to back up and restore the registry in Windows:  https://support.microsoft.com/en-us/topic/how-to-back-up-and-restore-the-registry-in-windows-855140ad-e318-2a13-2829-d428a2ab0692

    1. Click Windows + R and enter regedit to open the Registry Editor.
    2. Navigate to HKEY_CLASSES_ROOT > CLSID. Inside the folder, please search (CTRL + F) for OneDrive.
    3. Find the OneDrive – PCName value and looks something like the screenshot below:
      User's image
    4. Delete the folder.
    5. Restart the computer.

    Just checking in to see if the information was helpful. Please let us know if you would like further assistance.


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.