Generally, we need to unlink the OneDrive account before you close the Microsoft 365 Account, as this action needs you login to OneDrive.
Currently, I would suggest you try following steps, but serious problems might occur if you modify the registry incorrectly. Before you modify it, please remember to back up the registry for restoration in case problems occur.
If you do not want to modify the registry keys, please create a new local administrator account.
- Exit OneDrive by right clicking on the OneDrive icon > Click Exit or Quit OneDrive.
- Open the Registry Editor by searching regedit > OK.
- Navigate to
HKEY_CURRENT_USER > Software > Microsoft > OneDrive > Accounts > BusinessX
. - "X" is the amount of Business accounts that you have logged into previously. Find the specific one by looking at the UserEmail value. After you found the correct one, delete the entire folder (BusinessX).
- Navigate to
HKEY_CLASSES_ROOT > CLSID
. Inside the folder, search (CTRL + F) to find keyword: OneDrive.
Find next until you find one that has the "OneDrive – xxx" as the Default value and looks something like the screenshot below:
Delete the string subfoler.
- If there is local OneDrive folder of the account in Windows File Explorer, please back up the files you need in this folder.
- Then locate to
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Desktop\NameSpace
, expand this folder, there will be subfolders with key names of a long string as above. - Find the one includes (Default) with “Onedrive - xxx” in right “Data” column, delete the string subfoler.
- Go to
C:\Users\<User Name>\OneDrive - xxx
, deleate it.
If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.