| Previous | Next |
| STATUS_CANCELLED | STATUS_INVALID_COMPUTER_NAME |
STATUS_CANNOT_DELETE
Deletion was requested, but the object is not currently deletable
STATUS_CANNOT_DELETE should be investigated as a file-lifecycle and access problem. Windows deletion is not simply a pathname removal: a handle requests delete disposition, the caller needs delete rights, share modes of other opens matter, and actual namespace removal can be deferred until relevant handles close.
Start with the object that was actually opened and the handle used to request deletion. A process holding the same file without delete sharing can block the transition. An ACL can deny the required access. A directory may still contain entries, and file-system corruption can also leave an object in a state that normal deletion cannot process. These causes require different fixes.
Do not respond by repeatedly renaming or recreating the path. If deletion is already pending, later operations have different semantics; if the blocker is an open handle, retries only race the same owner. Preserve the first failure and enumerate the open-handle and share state before changing the file.
What to inspect
- DELETE access on the handle and the parent-directory rights relevant to the operation.
- Other handles to the file and whether they were opened with
FILE_SHARE_DELETE. - Delete-pending state, mapped sections, directory contents, and file-system health.
References
- Microsoft: FILE_DISPOSITION_INFORMATION
- Microsoft: Cannot delete files on NTFS
- Microsoft Open Specifications: FileDispositionInformation
- Microsoft Open Specifications: NTSTATUS values
Looking for a different code? Search another status or error code.
