Microsoft Windows 10 OneDrive Update Corruption

If one has an error occur within the .\AppData\Local\Microsoft\OneDrive folder, all one has to do is:

  1. Verify the update version and the currently installed version via the XML update file
  2. Attempt to remove the OneDrive version folder by re-owning the folder
  3. Restart the computer
  4. Finish removing the folder
  5. (Optional) Restart the computer
  6. Update or re-install OneDrive via the application in the OneDrive folder

This solution is based around the broken OneDrive update version 18.212.1021.0008 which was rolled back to 18.212.1021.0007.

Truncated PowerShell

This is for people who know how to use PowerShell and do not need any information other than the commands and order.

cd .\AppData\Local\Microsoft\OneDrive
dir
cd update
dir
Get-Content .\update.xml
cd ..
dir
takeown /R /F 18.212.1021.0008
icacls "18.212.1021.0008" /T /grant Users:F
rd /S /Q 18.212.1021.0008
shutdown /r /t 0
cd .\AppData\Local\Microsoft\OneDrive
dir
cd 18.212.1021.0008\
dir
takeown /R /F amd64
icacls "amd64" /T /grant Users:F
cd amd64
dir
takeown /R /F FileSyncShell64.dll
icacls "FileSyncShell64.dll" /T /grant Users:F
cd ..
cd ..
dir
rm /S 18.212.1021.0008
dir
start .\update
shutdown /r /t 0
cd .\AppData\Local\Microsoft\OneDrive
dir
cd update
dir
Get-Content .\update.xml

Full Powershell

cd into .\OneDrive

cd .\AppData\Local\Microsoft\OneDrive
dir
Directory: C:\Users\<user>\AppData\Local\Microsoft\OneDrive

17.3.7131.1115
18.172.0826.0010
18.212.1021.0008
LogoImages
logs
settings
setuo
StandaloneUpdater
Update
OneDrive.exe
OneDrive.VisualElementsManifest.xml
OneDriveStandaloneUpdater.exe
Resources.pri

cd into Update

cd update
dir
Directory: C:\Users\<user>\AppData\Local\Microsoft\OneDrive\Setup

OneDriveSetup.exe
update.xml
Get-Content .\update.xml
<?xml version="1.0" encoding="utf-8"?>
<root>
    <update throttle="100" rescan="1440" currentversion="18.212.1021.0008" maxapplicable="18.212.1021.0007" minapplicable="16.000.0000.0000">
        <binary ## />
    </update>
    <update throttle="1" rescan="1440" currentversion="18.222.1104.0007" maxapplicable="18.999.9999.9999" minapplicable="16.000.0000.0000">
        <binary ## />
    </update>
</root>

cd to OneDrive

cd ..
dir
Directory: C:\Users\<user>\AppData\Local\Microsoft\OneDrive

17.3.7131.1115
18.172.0826.0010
18.212.1021.0008
LogoImages
logs
settings
setuo
StandaloneUpdater
Update
OneDrive.exe
OneDrive.VisualElementsManifest.xml
OneDriveStandaloneUpdater.exe
Resources.pri

Take Ownership of 18.212.1021.0008

takeown /R /F 18.212.1021.0008
icacls "18.212.1021.0008" /T /grant Users:F

Attempt to Remove 18.212.1021.0008

rd /S /Q 18.212.1021.0008
"Access is denied"

"File is open in another program"

"File is open in Windows Explorer"

"You do not have permission to delete this file"

Restart the Computer

shutdown /r /t 0

cd into OneDrive

cd .\AppData\Local\Microsoft\OneDrive
dir
Directory: C:\Users\<user>\AppData\Local\Microsoft\OneDrive

17.3.7131.1115
18.172.0826.0010
18.212.1021.0008
LogoImages
logs
settings
setuo
StandaloneUpdater
Update
OneDrive.exe
OneDrive.VisualElementsManifest.xml
OneDriveStandaloneUpdater.exe
Resources.pri
cd 18.212.1021.0008\
dir
Directory: C:\Users\<user>\AppData\Local\Microsoft\OneDrive\18.212.1021.0008

amd64

Take Ownership of .\amd64

takeown /R /F amd64
icacls "amd64" /T /grant Users:F
cd amd64
dir
Directory: C:\Users\<user>\AppData\Local\Microsoft\OneDrive\amd64

FileSyncShell64.dll

Take Ownership of .\FileSyncShell64.dll

takeown /R /F FileSyncShell64.dll
icacls "FileSyncShell64.dll" /T /grant Users:F

cd into .\OneDrive

cd ..
cd ..
dir
Directory: C:\Users\<user>\AppData\Local\Microsoft\OneDrive

17.3.7131.1115
18.172.0826.0010
18.212.1021.0008
LogoImages
logs
settings
setuo
StandaloneUpdater
Update
OneDrive.exe
OneDrive.VisualElementsManifest.xml
OneDriveStandaloneUpdater.exe
Resources.pri

Remove 18.212.1021.0008

rm /S 18.212.1021.0008
dir
Directory: C:\Users\<user>\AppData\Local\Microsoft\OneDrive

17.3.7131.1115
18.172.0826.0010
LogoImages
logs
settings
setuo
StandaloneUpdater
Update
OneDrive.exe
OneDrive.VisualElementsManifest.xml
OneDriveStandaloneUpdater.exe
Resources.pri

Update OneDrive

start .\update

In the now open File Explorer, launch the OneDriveSteup application and follow the instructions to setup OneDrive with the latest files pulled from the Microsoft application install servers.

Restart the Computer

shutdown /r /t 0

Check Version in PowerShell

cd into OneDrive

cd .\AppData\Local\Microsoft\OneDrive
dir
Directory: C:\Users\<user>\AppData\Local\Microsoft\OneDrive

17.3.7131.1115
18.172.0826.0010
18.212.1021.0007
LogoImages
logs
settings
setuo
StandaloneUpdater
Update
OneDrive.exe
OneDrive.VisualElementsManifest.xml
OneDriveStandaloneUpdater.exe
Resources.pri

cd into Update

cd update
dir
Directory: C:\Users\<user>\AppData\Local\Microsoft\OneDrive\Update

OneDriveSetup.exe
update.xml
Get-Content .\update.xml
<?xml version="1.0" encoding="utf-8"?>
<root>
    <update throttle="100" rescan="1440" currentversion="18.212.1021.0007" maxapplicable="18.212.1021.0007" minapplicable="16.000.0000.0000">
        <binary ## />
    </update>
    <update throttle="1" rescan="1440" currentversion="18.222.1104.0007" maxapplicable="18.999.9999.9999" minapplicable="16.000.0000.0000">
        <binary ## />
    </update>
</root>