Unable to Delete Doc Library synced folder from Windows Explorer

Silver Contributor

Using Windows 10 OneDrive Sync client (17.005.0107.0008), synced a document library from SPO with one file.  

In windows Explorer, right clicked on synced doc library, received error message that the Action can't be completed because the folder or file is open in another program. The file was deleted from SPO and shows up in the Recycle bin, but the folder can't be deleted from Windows Explorer. Is this expected behavior? Is it due to the fact the library has been synced? 


@Stephen Rose  @Salvatore Biscari

18 Replies
Is your OneDrive under a preservation policy? If so you cannot delete folders.... which kind of makes the feature pretty bad experience. Hoping it's being looked at on the compliance side. You can tell if you look at the site contents of your OneDrive site and see if you have the preservation library. I forget what it's called off the top of my head.

If not could be something else I guess, but I would look there.

Thanks, but it is not a users onedrive site, it a document library from a team site. 

Same rules apply. If SharePoint is under preservation/hold etc.

ok, but in my test site, there are not holds of any kind. It is a standard group enabled team site. 

can you delete the same folder via web interface?

yes, i can deleted from the web site

Can you empty recycle bin,  temp folder in app data restart and see if the issue still exists.

So are you talking about a folder within a synced site itself? Or the root level folder under the Teanant name? Cause if it's that root folder that you synced itself, you got to reboot after removing the sync from settings to be able to delete cause the onedrive service holds onto it locally. Maybe stopping onedrive will let you too, but i just reboot.

Like you can sync just a folder inside a library, are you trying to delete a folder within that sync, or the actual folder you sync'd itself?

I'm talking about a document library that shows up a first level folder under the tenant in Windows Explorer. 

One of my clients stated that they accidentally deleted an entire library from Windows Explorer and i'm trying to figure out how that could have happened because I cant do it. 

Yeah, it's not possible to delete and actual document library from the onedrive client. So I would question that one :P.

But yeah you cannot delete the root folder, you have to "Unconfigure" that folder from sync. Then restart onedrive client services / reboot before you can remove the local folder that's left behind.

Hi @Dean_Gross.

If I understand well what you mean, you are correct: AFAIK, it is not possible to delete an entire synced document library using exclusively File Explorer.

In fact, as you have already found, File Explorer refuses to delete folders representing synced (i.e. with the green check mark) libraries under the "tenant" tree that appears in the left pane.

Of course, you can empty a synced library from File Explorer, but not delete it entirely.

In order to delete the library folder from the "tenant" tree, you must first stop the synchronization from the OneDrive client UI. After you have done it, the green checkmark will disappear from the corresponding folder icon and, at that point, you are able to actually delete the folder from the "tenant" tree in the left panel of File Explorer. No restart of the client or of the computer is needed before deleting the (not anymore synced) library.

Right click on the Windows Explorer Tenant folder - click on settings.  Click on 'Stop Sync' for the folder you want to delete. Hit OK.  Now you can delete the folder.

..At least my experience for O365 SharePoint Sync.

Thanks, @David Chamberlain. This resolved the issue for me.

@David ChamberlainThanks. This works on most folders, but not on all. Two folders refuse to disappear from the Windows Explorer view. A pop-up windows displays this error: 

Title: "Location is not available."

Error text: "C:\users\<abc>\<sharepointname> - documents\<channelname>\<projectname>\...\ABC is not accessible. The tag present in the reparse point buffer is invalid."


I found a post on that error on this link


In the above path, <abc> represents my user name, <sharepointname> represents a SharePoint site of which I sync the entire document folder to Windows. <channelname> is a document subfolder and also a channel in Teams. <projectname> is the name of a project. The entire path C:\...\ABC is a 14-level deep folder tree. ABC is the lowest level folder and contains no files. 


The relevant history is that this folder structure had contained project documentation, but the full tree, starting from <channelname> on down had been moved to a new SharePoint site. The path above was the longest one in the tree, and perhaps this triggered a bug. 



I have the same or similar issue.

A specific folder cannot be deleted or accessed. The folder is part of a OneDrive teams folder shared via MS Teams and locally synced in Windows.

The error I get when trying to access the folder is:
"Location is not available"
<Path to folder> "is not accessible.
"The tag present in the reparse point buffer is invalid"

Really annoying. Please fix.

@David Chamberlain You actually understood the problem and provided a clear solution! Thank you.

Stopping OneDrive and only then delete the folder that was creating the sync issue worked for me!

Many thanks!

@David Chamberlain Hi! y could unsync and then delete all the folders, but there is no way of deleting the building.  adyanis_0-1651592885661.pngThe building folder still appears, any way to delete it?