How to Delete Old OneDrive for Business Files After Leaving a Company
Question details
The user needs to remove residual OneDrive for Business files from their local computer after their enterprise account was deactivated.

- Product
- OneDrive for Business
- Device & OS
- not provided
- Scenario
- Leaving a company and needing to clean up the local machine from enterprise synchronized files without access to the business account.
- Observed behavior
- Files from the former employer's OneDrive library remain locally and cannot be deleted normally because the business account was removed.
Before deleting any folders, verify if there are any personal files accidentally saved in the business folder that you need to back up to a local drive. Ensure you no longer need access to the enterprise data, as removing the sync folder is permanent locally.
Unlink the Business Account and Remove the Sync Folder
Unlinking the account stops the synchronization process, allowing you to manually delete the leftover local files without encountering permissions or sync errors.
If your computer is still trying to sync files with a deactivated enterprise account, Windows may lock the files and prevent deletion. Stopping the sync process from within OneDrive settings resolves this file-lock issue.
Click the OneDrive cloud icon in your system tray (Windows taskbar or Mac menu bar), click the gear icon (Help & Settings), and select Settings.
Navigate to the Account tab and click 'Unlink this PC' next to the former employer's business account. Confirm the action when prompted to stop all syncing activities.
Open File Explorer (Windows) or Finder (Mac) and navigate to your user profile folder (e.g., C:\Users\YourUsername). Find the folder named 'OneDrive - [Company Name]'.
Select the entire business OneDrive folder and press the Delete key to remove the leftover local files permanently.

Delete Stubborn Files in Safe Mode
If files still cannot be deleted due to 'file in use' or permission errors after unlinking the account, restarting your computer in Safe Mode can bypass these restrictions.
Manage Your Local Documents Seamlessly with WPS Office
If you're transitioning away from enterprise Microsoft 365 accounts, WPS Office offers a powerful, lightweight, and free alternative to manage your personal and professional documents without complex cloud synchronization restrictions.
- 1. Download and Install: Get the free WPS Office installer from the official website and complete the quick installation process.
- 2. Open Your Local Files: Launch WPS Office and directly open your local documents, spreadsheets, and presentations without needing to sign into an enterprise cloud.
- 3. Save and Organize: Save your edited files directly to your local hard drive or a personal cloud storage solution of your choice.

Frequently Asked Questions
Why do I get an error saying the file is open in another program when deleting OneDrive files?
This happens because the background OneDrive sync process or Windows Explorer is still trying to access the file. Unlinking your OneDrive account first or closing OneDrive completely from the system tray usually resolves this file-lock issue.
Will deleting these local files delete them from the company's server?
No. If your account has already been deactivated or if you successfully clicked 'Unlink this PC', deleting the local folder will not affect the original files stored on the company's Microsoft 365 servers.
How do I recover a personal file I accidentally saved in my old work OneDrive?
If the local file was already deleted, check your local Recycle Bin. If it was only stored on the cloud and your business account is deactivated, you must contact your former employer's IT department to request a data export.
Can I keep the OneDrive application but remove the business account?
Yes, unlinking the business account from OneDrive Settings removes the enterprise sync connection but leaves the OneDrive application installed, allowing you to sign in and sync a personal Microsoft account instead.




