How to Fix Cannot Delete a OneDrive File Still in Session
Question details
The user is unable to rename or delete a file in OneDrive because the system indicates the file is currently open or still in an active session.

- Product
- Microsoft OneDrive
- Device & OS
- not provided
- Scenario
- Attempting to delete a synchronized or shared file from a local OneDrive folder or the web interface.
- Observed behavior
- OneDrive blocks the deletion, displaying an error that the file is open in another device, browser session, or by a guest collaborator.
Ensure you are connected to the internet so that your local OneDrive client can properly communicate with the cloud to update file statuses.
Close All Active Sessions and Delete via OneDrive Web
By closing the file on all connected devices and managing it directly from the cloud interface, you can bypass local file locks.
Often, a file is kept in session because it was left open in a browser tab or on a secondary device, preventing any modifications to its status.
Verify that the file is completely closed on all your desktop applications, mobile devices, and browser tabs.
Right-click the file, select 'Manage access', and stop sharing to ensure no guests currently have an active session open.
Log into OneDrive.com through your web browser, locate the file, right-click it, and select 'Delete' directly from the cloud portal.

Pause Synchronization and Delete the Local Copy
Pausing the OneDrive sync engine temporarily releases background processes that might be falsely holding the file open.
Manage and Edit Your Documents Seamlessly with WPS Office
If you are tired of dealing with complex file locks, syncing errors, and expensive subscriptions, WPS Office offers a lightweight, intuitive, and highly compatible alternative. Enjoy seamless document editing and reliable built-in cloud integration without the hassle.
- 1. Download and Install: Get the free WPS Office application from the official website and run the quick installer.
- 2. Open Your Files: Launch WPS Office and easily open any existing Word, Excel, or PowerPoint files stored on your local drive or cloud storage.
- 3. Edit and Save: Make your edits with full formatting support and save directly to WPS Cloud or your preferred local folder.

Frequently Asked Questions
Why does OneDrive say my file is in use when it's closed?
This usually occurs if a background synchronization process is stuck, or if the file was recently accessed via an Office web app and the cloud session hasn't completely timed out yet.
Does removing a sharing link immediately end a guest's session?
Removing sharing access prevents new users from opening the file, but if someone currently has the file open in their browser, they may still maintain a temporary hold on it until they close their tab.
Can I force delete a file using Command Prompt?
Yes, if the local file is locked, you can open Command Prompt as an administrator and use the 'del' command followed by the file path. However, it is safer to pause OneDrive syncing first to prevent sync conflicts.




