Forum Discussion

scooter4483's avatar
scooter4483
Copper Contributor
Feb 15, 2024

Cannot remove SP documents library from OneDrive in File Explorer

Hi,

I need some guidance.  There is a big SP site that houses a lot of data in the documents library at my org. Recently, our end users are getting a onedrive sync error because some files in the SP site have too many characters which I believe is a results of how deep of folders the files are.  Anyway, I wanted to remove the shortcut from file explorer but cannot.  I navigated to the users onedrive on the web, located the SP documents library that was there, and chose 'remove' from the 3 dots.  Now, the onedrive client is not syncing or broken on the end user's computer and does not remove it from file share (sync from onedrive web to client and file explorer).  I do not get a 'remove shortcut' option either and am guessing it is because onedrive has a broken sync.  I've reset onedrive and uninstalled/reinstalled it, and even tried to clear everything from the %localappdata\microsoft\onedrive folder.  Not all the folders get deleted from there. I know this just clears the cache but should every folder be removed?  Regardless, I right-click on the shortcut in file explorer and choose delete and it says it is moving to the recycle bin but does not.  Any ideas on how I can remove it from file explorer under onedrive even after it is removed from onedrive on the web.  Thanks!

  • BarryGoblon's avatar
    BarryGoblon
    Iron Contributor
    Tackling OneDrive sync errors and removing SharePoint document library shortcuts from File Explorer demands a bit of finesse, especially when long file paths are the root of the issue. Despite trying to remove the shortcut through OneDrive online, resetting OneDrive, and attempting to clear the cache, the problem persists.

    A smoother strategy involves ensuring OneDrive sync is halted to prevent further conflicts. Then, diving into OneDrive's settings to manually disconnect the library could be the trick. This involves navigating to the settings and finding an option to deselect the problematic library, though it's not always straightforward due to varying sync issues. When direct methods don't pan out, commanding the situation through Command Prompt with admin rights might be necessary. Using the rmdir command to remove the folder demands precision and caution to avoid unintended data loss.

    Permissions in SharePoint Online could also be a blockade. Ensuring you have the right permissions to make changes is crucial. Persisting issues often mean reaching out to Microsoft Support is the best course of action, as they can offer targeted advice for these situations. Additionally, it's an opportune moment to guide users on file naming and folder structures in SharePoint, aiming to dodge character limit issues from the start. Approaching folder and file manipulations, especially with command-line tools, requires careful consideration. If uncertainty lingers, leaning on IT professionals or Microsoft Support is a prudent choice.
    • scooter4483's avatar
      scooter4483
      Copper Contributor

      The below steps will reset OneDrive and clear the cached OneDrive information. Please complete all steps.

      To reset OneDrive:

      • Click on OneDrive sync icon.

      • Click on settings.

      • Click on Unlink this PC.

      --------------------------------------
      • Uninstall OneDrive from the laptop via programs/features.

      • Press the Windows key and to open the Run dialog box.

      • Copy any of this and paste it into the dialog window, then press OK.
        %localappdata%\Microsoft\OneDrive\onedrive.exe /reset

      • C:\Program Files\Microsoft OneDrive\onedrive.exe /reset

      • C:\Program Files (x86)\Microsoft OneDrive\onedrive.exe /reset

      ---------------------------------------------------------------------------------

      To clear OneDrive cached information:

      • In the window search bar, type in credential Manager.

      • Click on Windows Credential

      • Click on the drop down beside OneDrive, then click on remove. (Remove all OneDrive).

       

      Next:

      • In the widow search bar, type in Registry Editor.

      • Click on HKEY_CURRENT_USER >>>>> SOFTWARE >>>>> MICROSOFT >>>>> Right click on OneDrive and then delete.

       

      Next:

      • Launch your File Explorer.

      • Click on this PC.

      • Click on Windows C: Drive

      • Click on User.

      • Click on the affected user.

      • Rename all OneDrive by appending (.old) when renaming.

      Lastly:

      • Log in to user OneDrive on the web.

      • Click on settings.

      • Click on sync this OneDrive.

      ------------------------------------------------

      • Restart the laptop and install the OneDrive application. Sign into OneDrive and allow it to sync.

      • Open File Explorer and confirm the SharePoint site that you had syncing as a shortcut in OneDrive is no longer present.

       

Resources