Updated on November 6th, 2020
This post is going to fix error “An unexpected error is keeping you from deleting the file” in Wondows. This guide provides two solutions to help you delete the file successfully.
Symptom of “An unexpected error is keeping you from deleting the file”
The issue being discussed in the post is quietly unexpected, as it is hard to tell when it will occur. It might come up when you attempt to delete some files or folders, and the error message appears on the “1 corrupted action” message box:
“An unexpected error is keeping you from deleting the file. If you continue to receive this error, you can use the error code to search for help with this problem.”
Usually, the error message is followed with an error code which might varies based on different situations. Here are some error codes you may encounter together with the issue:
- Error 0x80007005: Access is denied.
- Error 0x80070091: The directory is not empty.
- Error 0x800710FE: This file is currently not available for use on this computer
- Error 0x80004005: Unspecified error
Causes of An unexpected error is keeping you from deleting the file
The error that you cannot delete file or folder in Windows can be caused by many reasons. Here are some possible reasons you can refer to:
- You do not have permission to delete the file or folder in question.
- The file or deleted you try to delete is in use or corrupted.
- There are bad sectors on the hard drive, preventing you from normal actions.
- Virus or malware damages the file that cannot be deleted.
- Some third party software is not compatible with current operating system.
- The file or folder is encrypted, write-protected or shared via network, and it is not allowed to be deleted.
How to fix “An unexpected error is keeping you from deleting the file”?
Method 1: Fix the error via Registry Editor
Disclaimer: This method includes steps done to registry. Improper operations in registry may lead to system issues like crash, blue screen, etc. Be careful when editing registry. If you follow steps here correctly, you should not have any problems.
- Open Registry Editor. Click Start menu and type “regedit” in the searching box. Then right-click “regedit.exe” from searching result and choose “Run as administrator”
- Expand the directory on the left pane of Registry Editor following the path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CSC\Parameters
- Select the key “Parameters” and look for item “FormatDatabase” on the right part. If there is not such item, right-click blank area and select New -> DWORD Value. Then rename the new item as FormatDatabase.
- Double click “FormatDatabase” and you can modify the Value data to 1. Click OK button to save changes and close Registry Editor.
- Restart computer and check if the issue is fixed.
Method 2: Fix the problem using disk management tool
This solution is much easier compared with editing registry. We can use a free Windows partition manager tool – Eassos PartitionGuru Free to delete the file. This partition tool is able to delete files that cannot be deleted via Windows, delete files permanently in case of recovery, wipe partition, erase disk. Let’s see how to delete files when you are kept from deleting data.
- Install and launch Eassos PartitionGuru Free from your computer. Then locate the file or folder you want to delete.
- Select files or folders that cannot be deleted, right-click them and choose “Delete Files Directly”.
- Click “Delete” button to complete the deletion.
Note: this deletion deletes the file directly instead of putting data to Recycle Bin. Please make sure you are deleting files correctly. If you delete files by mistake, you can use this software to recover deleted files.