OneDrive Folder Keeps Reappearing
Resolution Checklist
- 1 Understand why folders keep recreating
- 2 Check Windows system folder mappings
- 3 Delete locked directories on Windows
- 4 Purge hidden system files and directories on macOS
- 5 Verify application folder generation pathways
- 6 Summary Checklist
OneDrive Folder Keeps Reappearing
If a folder you delete from Microsoft OneDrive keeps coming back, it is usually because the folder contains hidden system files (such as desktop.ini or .DS_Store) that are locked by your operating system’s file explorer. When the shell locks these files, the deletion fails locally, and the OneDrive sync engine pulls the parent folder back down from the cloud.
This guide provides steps to remove hidden files, disable system directory links, and permanently delete persistent folders on Windows and macOS.
Understand why folders keep recreating
Folder regeneration is usually caused by one of three scenarios:
- Hidden OS Files: Desktop customization files (
desktop.iniorThumbs.dbon Windows,.DS_Storeon macOS) are locked by the system shell during deletion. - Relocated System Folders: You have redirected your default Documents, Pictures, or Desktop folder to OneDrive. Windows will recreate these folders automatically if they are deleted.
- Application Workspaces: A local program (such as Adobe, Visual Studio, or Outlook) is configured to use that folder for automatic backups or scratch space, recreating the folder whenever the app is launched.
Check Windows system folder mappings
If you try to delete standard folders like “Documents”, “Desktop”, or “Pictures” and they reappear:
- Right-click the folder in File Explorer and select Properties.
- If there is a Location tab, this folder is a redirected Windows Shell Folder.
- Do not delete this folder. If you want to stop syncing it to OneDrive, you must restore its default location:
- Click Restore Default in the Location tab.
- Or click the OneDrive Cloud Icon -> Settings -> Sync and backup -> Manage backup and toggle off the folder backup.
Delete locked directories on Windows
To delete a folder that keeps reappearing due to a locked desktop.ini or Thumbs.db file:
1. Stop the Windows Explorer Shell and OneDrive
Open a Command Prompt as Administrator and kill the file explorer shell and the OneDrive engine:
taskkill /f /im explorer.exe
taskkill /f /im OneDrive.exe
2. Remove Hidden and System Attributes from Files
Navigate to your OneDrive directory and remove file locks (replace ExampleFolder with the name of the folder you want to delete):
attrib -h -s -r "%USERPROFILE%\OneDrive\ExampleFolder\*.*" /s /d
3. Delete the Folder via Command Prompt
Force delete the directory tree:
rd /s /q "%USERPROFILE%\OneDrive\ExampleFolder"
4. Restart Explorer and OneDrive
start explorer.exe
start "" "%localappdata%\Microsoft\OneDrive\OneDrive.exe"
Purge hidden system files and directories on macOS
On macOS, Finder automatically creates .DS_Store files to save folder view settings. If a folder cannot be deleted because of a locked .DS_Store file, you can delete it using Terminal.
1. Find and Delete Hidden Files
Open Terminal and delete all .DS_Store instances inside the target folder (replace ExampleFolder with the actual folder name):
find ~/Library/CloudStorage/OneDrive-Personal/ExampleFolder -name ".DS_Store" -depth -exec rm {} \;
2. Force Remove the Folder
Remove the directory and all of its contents:
- For Personal Accounts:
rm -rf ~/Library/CloudStorage/OneDrive-Personal/ExampleFolder - For Business/School Accounts:
rm -rf ~/Library/CloudStorage/OneDrive-Shared/ExampleFolder
3. Clear the macOS FileProvider Cache
If the folder remains visible in Finder as a ghost placeholder, flush the file daemon:
killall -9 fileproviderd
Verify application folder generation pathways
If the folder still reappears, a running application is likely recreating it:
- Audit Active Apps: Note the exact time the folder reappears.
- Check App Preferences: Programs like Adobe Creative Cloud, Steam, Microsoft Teams, and Python virtual environments often auto-create default folders in your user directory.
- Change App Settings: Change the save path in the offending application’s settings to a location outside of your OneDrive directory.
Summary Checklist
| Action Item | Verification Method | Status |
|---|---|---|
| Manage Folder Backups | Verify redirected shell folders are turned off in OneDrive Backup Settings | [ ] |
| Kill Explorer & Client | Run taskkill for explorer.exe and OneDrive.exe (Windows) | [ ] |
| Strip System Attributes | Run attrib -h -s -r to unlock files on Windows | [ ] |
| Delete via CLI | Execute rd /s /q (Windows) or rm -rf (macOS) | [ ] |
Clear macOS .DS_Store | Delete Finder configuration files using Terminal | [ ] |
| Audit Third-Party Apps | Repoint application default directories away from OneDrive | [ ] |