Fix Cannot Delete a SharePoint File Synced to OneDrive
Question details
The user is unable to delete a locally synchronized SharePoint file (often a zero-byte file) via OneDrive, despite the file no longer being visible online.

- Product
- Microsoft OneDrive and SharePoint
- Device & OS
- not provided
- Scenario
- Attempting to clean up a locally synchronized SharePoint folder after a document application crash leaves a persistent, locked zero-byte file.
- Observed behavior
- The zero-byte file remains in the local folder, is locked by OneDrive synchronization processes, and cannot be deleted normally by the user.
Before attempting to delete the file locally, log into your SharePoint account via a web browser to confirm that the file has indeed been removed from the online library to prevent accidental data loss.
Stop Syncing and Delete the Local File
Stopping the synchronization process temporarily releases the system lock on the file, allowing you to delete it from your local drive.
When an application crashes, it can leave behind a zero-byte file that OneDrive continuously attempts to sync. This creates a file lock, preventing standard deletion. By stopping the sync for the specific SharePoint library, you remove the lock without affecting your files in the cloud.
Right-click the OneDrive cloud icon in your system tray (taskbar) and select the gear icon to open 'Settings'.
Go to the 'Account' tab, locate the synced SharePoint library in the list, and click 'Stop sync'.
Open File Explorer, navigate to the local SharePoint folder that contains the zero-byte file, and delete it.
If necessary, return to SharePoint online and click 'Sync' to reconnect the library to your local folder.

Unlink or Reset the OneDrive Client
If stopping the sync for a single library does not work, unlinking your account or resetting the entire OneDrive client can clear stuck synchronization caches.
Manage Your Documents Seamlessly with WPS Office
Tired of complicated synchronization issues and locked files? WPS Office is a free, lightweight, and easy-to-use alternative to Microsoft Office. It offers robust document management, built-in cloud storage, and seamless compatibility with all your existing files, minimizing the risk of app crashes.
- 1. Download WPS Office: Visit the official WPS website to download and install the free office suite on your computer.
- 2. Open Your Files: Open your existing Microsoft Office or PDF documents directly within WPS Office.
- 3. Sync Safely: Save and sync your files effortlessly using the integrated WPS Cloud without relying on external sync clients.

Frequently Asked Questions
Why is my SharePoint file showing as zero bytes?
A zero-byte file often occurs when an application (such as a PDF editor) crashes during the save process. It leaves an empty placeholder file that OneDrive struggles to sync, resulting in an indefinite sync loop.
Will stopping the sync delete my other SharePoint files?
No, clicking 'Stop sync' only severs the connection between your local folder and the online SharePoint library. Your locally downloaded files and online cloud files will remain completely intact.
What happens when I 'Unlink this PC' in OneDrive?
Unlinking your PC signs you out of OneDrive and pauses all synchronization. Your locally saved files stay on your hard drive, and cloud files remain safe online, allowing you to troubleshoot sync locks securely.
What should I do if resetting OneDrive doesn't fix the undeletable file?
If the file remains locked even after a OneDrive reset, restart your computer in Safe Mode to prevent third-party background processes from locking the file, then attempt to delete it using File Explorer.




