Can't remove, rename or copy old OneDrive folder (0x8007016B)

11

I recently did a reset of my Windows 10 computer.

I have two drives connected:

  • C: an SSD, and
  • D: two regular HDDs forming a dynamic mirrored drive within Windows.

On the D: drive I had my old onedrive folder. d:\OneDrive after the reinstallation of Windows 10 it automatically made the OneDrive appear here: c:\users\xxx\Onedrive

I now want to remove my old onedrive folder on my D: drive. The problem is that windows won't allow me to delete, rename, copy or move that old folder. Giving me this error:

Error 0x8007018B: Access to the cloud file is denied.

Since it is a mirrored drive I can't easily but a portable unix-OS to modify it directly, so now I do not know what to do. That error message is not very documented on the web.

windows
permissions
onedrive
asked on Super User Jun 22, 2018 by ehm • edited Jun 23, 2018 by ehm

3 Answers

12

I was able to get rid of my old OneDrive folder by opening Powershell(admin). Then going to parent directory and using the command

Remove-Item "OneDrive folder name" -Recurse -Force

To open Powershell, press the Window key and X

answered on Super User Nov 24, 2018 by Johnathan Ayling • edited Nov 24, 2018 by Blackwood
4

You need to disable first “Files-On-Demand” feature in OneDrive:

  1. Right-click OneDrive in the System Tray Click the menu icon -> Settings -> Settings tab -> “Files-On-Demand” section -> disable the “Save space and download files as you use them” option
  2. Now run Remove-Item .\Your_Folder_Name\ -Force

If still doesn't work and you face the error:

Remove-Item : There is a mismatch between the tag specified in the request and the tag present in the reparse point

then do this:

  1. run Dism /Online /Cleanup-Image /CheckHealth
  2. run Dism /Online /Cleanup-Image /ScanHealth
  3. run Dism /Online /Cleanup-Image /RestoreHealth
  4. and now on an elevated prompt run cmd /c rmdir /s /q C:\Users\Your_User_Name\Your_Folder_Name

PowerShell cannot handle broken symlink, use the hammer, use CMD.

answered on Super User Dec 15, 2020 by Francesco Mantovani • edited Dec 15, 2020 by Francesco Mantovani
0

I managed to delete the folder by using boot deleter. I just had to make sure to give it admin privileges by right clicking the .exe -> properties -> compatability -> run as admin.

answered on Super User Jun 25, 2018 by ehm

User contributions licensed under CC BY-SA 3.0