This article guides you on how to completely reset the Microsoft OneDrive app on Mac and remove persistent folders or shortcuts from the CloudStorage directory that reappear even after deletion.
When you remove files from OneDrive or uninstall the app on macOS, the Mac's file system (through the File Provider background process) may keep synchronization domains active. This causes folders like Shared Libraries to be automatically recreated in the CloudStorage folder.
To resolve the issue and perform a complete cleanup on the system, follow the procedure below by running a command via Terminal.
Procedure for complete reset and removal
Open Finder, go to Applications, Utilities, and open Terminal (or press Command + Space, type Terminal, and press Enter).
Copy the following command in its entirety:
sudo bash -c '
killall OneDrive 2>/dev/null
killall fileproviderd 2>/dev/null
[ -f "/Applications/OneDrive.app/Contents/Resources/ResetOneDriveAppStandalone.command" ] && bash "/Applications/OneDrive.app/Contents/Resources/ResetOneDriveAppStandalone.command" 2>/dev/null
[ -f "/Applications/OneDrive.app/Contents/Resources/ResetOneDriveApp.command" ] && bash "/Applications/OneDrive.app/Contents/Resources/ResetOneDriveApp.command" 2>/dev/null
rm -rf ~/Library/CloudStorage/OneDrive*
rm -rf ~/Library/Application\ Support/FileProvider/com.microsoft.OneDrive*
rm -rf ~/Library/Application\ Support/OneDrive ~/Library/Caches/com.microsoft.OneDrive ~/Library/Preferences/com.microsoft.OneDrive* ~/Library/Group\ Containers/UBF8T346G9.OneDrive* ~/Library/Containers/com.microsoft.OneDrive*
killall fileproviderd 2>/dev/null
'Paste the command into Terminal and press Enter.
The system will prompt for your Mac administrator password. Enter your password and press Enter. For security reasons, the password characters will not be displayed on the screen as you type.
What this command does on the system:
Terminates the OneDrive and fileproviderd subsystem processes to release file locks.
Runs the official reset script provided by Microsoft, if the app is still installed.
Removes all folders and shortcuts associated with OneDrive inside ~/Library/CloudStorage/.
Clears FileProvider cache records that cause automatic folder recreation.
Deletes OneDrive support files, preferences, and containers stored in the user library.
Restarts macOS file integration service to refresh the system state.
If there is an issue with macOS default folders due to a backup configured in OneDrive, run:
rm ~/Desktop 2>/dev/null
rm ~/Documents 2>/dev/null
mkdir ~/Desktop
mkdir ~/Documents
touch ~/Desktop/.localized
touch ~/Documents/.localized
killall Finder