Skip to content

OneDrive Helper v0.10.5 (fixes leftover folders nobody could remove, found on RDS)

Choose a tag to compare

@denismcapple denismcapple released this 22 Oct 18:23
· 1 commit to main since this release

Fixes a leftover folder nobody could remove (found on a Remote Desktop server)

On an RDS session host, a leftover copy of a SharePoint library (ACME-Training - Documents (1), next to the real, syncing ACME-Training - Documents) couldn't be moved or deleted by anyone, administrators included. The error was "Access to the cloud file is denied", and a server restart didn't help. Two separate things were blocking it. 0.10.5 clears both by itself, as the user, with no extra admin step.

1. Windows still had the folder registered as a OneDrive sync folder

OneDrive stopped syncing the library long ago but never unregistered it. Windows keeps a sync folder's registration on the folder itself as well as in the registry. The registry entry was gone, but the one on the folder wasn't, so Windows' Cloud Files driver still protected the folder, with OneDrive no longer connected to it. Because the registration is stored on disk, a restart changes nothing.

Fix: before moving a folder, OneDrive Helper now asks Windows whether the folder itself is a OneDrive sync folder with nothing connected to it (and OneDrive's settings don't list it as synced). If so, it removes that dead registration with Windows' CfUnregisterSyncRoot, logs event 5017, and carries on. No files are touched. If the registration can't be removed, the folder is skipped with a clear message and event 5016.

2. OneDrive had made the copies undeletable

The user could only read that library, so OneDrive had put Everyone:(DENY)(D,WD,AD,DC) on every local copy. A deny entry beats every allow, administrators included.

Fix: the user owns the files in their own profile, and an owner can always change a file's permissions. After the backup is verified, OneDrive Helper removes exactly that deny entry from the copies it's about to delete, then deletes them as before. No other permission is changed. The library that's still syncing keeps its read-only protection.

Also

  • The fix only says a file is "open in another program" when it really is open. Otherwise it says Windows wouldn't allow the delete, and why.
  • The "Your support team will need to add … back" line is gone from the result card and the folder lists. For leftover copies there's nothing to add back.
  • Neither block is a locked file, so no restart or sign-out is offered for them (it wouldn't help).

The full write-up, including how to clear such a folder by hand on an older version, is on the project page under What we learned on Remote Desktop servers.

Downloads

File For
OneDriveHelper-v0.10.5-x64.zip 64-bit Intel/AMD PCs and servers
OneDriveHelper-v0.10.5-arm64.zip ARM64 PCs
SHA256SUMS.txt Checksums (the RMM install script on the project page is filled in for this release)

Settings carry over on upgrade. Event IDs are unchanged apart from the new 5016 and 5017.