Share via

Onedrive corrupted many software projects

Anonymous
2022-06-28T12:38:24+00:00

HELP! Microsoft onedrive has corrupted many files by changing the name from “myfile” to “myfile-DEKSTOP-7CC49LB”. This happened when I bought a new laptop, and signed in to my microsoft account with the new laptop. I then tried to access my onedrive folder and found out that all my projects where outdated. Then I had a look at my old laptop and found out onedrive was not synching anymore (probably has not been synching for months already) for unknown reasons. I reset onedrive on my old laptop and then it started uploading all the files that it had not uploaded for quite some time. And now I found out that a lot of file names have changed, and therefore a lot of my software projects have been corrupted.

Here’s the problem: I am a PLC software engineer. My software projects are stored in onedrive folders. When I want to open one of these projects with my application it gives me a bunch of errors because a lot of file names have been changed, so they cannot be found anymore.

Simply changing the names back from “myfile-DEKSTOP-7CC49LB” to “myfile” would not work, because:

  • there are thousands, if not tens of thousands of files that have been renamed, manually editing them would take forever
  • the original file “myfile” also still exists! This however is the old version that I would like to delete

Here is an example of a software project that cannot be opened anymore:

You can see for instance the following files:

MaeExp: this is a file belonging to the 'old' version of this software project

MaeExp-DEKSTOP-7CC49LB: this is the correct file, belonging to the newest version of this project. BUT the application cannot open this because it does not recoginze the name!

So what needs to happen is: the old file ( "MaeExp" in this example) needs to be deleted, and the "-DEKSTOP-7CC49LB" extension needs to be deleted (so that "MaeExp-DEKSTOP-7CC49LB" gets renamed to "MaeExp")

Windows for home | Windows 11 | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

3 answers

Sort by: Most helpful
  1. Anonymous
    2022-07-02T12:53:06+00:00

    Unfortunately no support from microsoft for this issue. I have since resolved this by writing a visual basic app to automatically delete the old files, and rename the files with the '-DEKSTOP-7CC49LB' extension. Here is the code if someone else runs into the same problem:

    Public Class Form1

        Dim CopyCtr As Long

        Private Sub BtnRename_Click(sender As Object, e As EventArgs) Handles BtnRename.Click

            Call LoopAllSubFolders("C:\Users\koen\Downloads")

            TxtBox.Text = CopyCtr & " copies found and renamed"

        End Sub

        Sub LoopAllSubFolders(ByVal folderPath As String)

            Dim fileName As String

            Dim fullFilePath As String

            Dim fullFilePathToDelete As String

            Dim newFileName As String

            Dim numFolders As Long

            Dim folders() As String

            Dim i As Long

            If folderPath.PadRight(1) <> "" Then

                folderPath &= ""

            End If

            fileName = Dir(folderPath & "*.*", vbDirectory)

            While Len(fileName) <> 0

                If fileName.PadLeft(1) <> "." Then

                    fullFilePath = folderPath & fileName

                    If (GetAttr(fullFilePath) And vbDirectory) = vbDirectory Then

                        ReDim Preserve folders(numFolders)

                        folders(numFolders) = fullFilePath

                        numFolders += 1

                    Else

                        Debug.Print(fullFilePath)

                        If InStr(fileName, "-DESKTOP-7CC49LB") Then

                            newFileName = Replace(fileName, "-DESKTOP-7CC49LB", "")

                            fullFilePathToDelete = folderPath & newFileName

                            My.Computer.FileSystem.DeleteFile(fullFilePathToDelete)

                            My.Computer.FileSystem.RenameFile(fullFilePath, newFileName)

                            CopyCtr += 1

                        End If

                    End If

                End If

                fileName = Dir()

            End While

            For i = 0 To numFolders - 1

                LoopAllSubFolders(folders(i))

            Next i

        End Sub

    End Class

    This worked perfectly and I can now access all my projects again.

    Was this answer helpful?

    0 comments No comments
  2. Anonymous
    2022-06-28T12:54:43+00:00

    I have not installed 365. I use office proffessional plus on both laptops.

    Onedrive versions on both laptops are: 2022 (build 22.121.0605.0002) 64 bit

    I was not notified on any onedrive synch inssues on the old laptop, it was just stuck on uploading files at 0kb/s. That's when I reset onedrive by entering the command %localappdata%\Microsoft*OneDrive**onedrive*.exe /reset

    After this onedrive restarted again and started uploading all my work, but after that I discovered that a lot of files had been renamed with the "-DEKSTOP-7CC49LB" extension

    Was this answer helpful?

    0 comments No comments
  3. Anonymous
    2022-06-28T12:44:35+00:00

    You have failed to mention what 365 license type you had?

    On the new PC you install 365 via the MS Account associated with MS Office

    Nothing in OneDrive content would have changed

    On the old pc you would have been notified on any OneDrive sync issues

    Was this answer helpful?

    0 comments No comments