How to Remove a File That Cannot Be Deleted

Copper Contributor

I am currently using Windows 11 23H2 on my computer. Recently, I encountered an issue with a file that was created by 7Zip and stored in the C:\Temp directory on my Samsung 990 Pro SSD. The problem arose when 7Zip crashed during the file zipping process, resulting in the file becoming undeletable.

 

Despite my attempts to delete the file using Explorer run as an administrator, I continually received an error message stating, "Could not find this item" and "This is no longer located in C:\Temp. Verify the items location and try again." Even after trying to delete the file in safe mode and running "chkdsk /f" on my C: drive, the file remained inaccessible, persisting as the only item in the C:\Temp directory.

 

I have also encountered difficulty in deleting or renaming the C:\Temp directory itself. This issue has proven to be persistent and baffling. How should I proceed to resolve this predicament?

3 Replies
The file might be used by another background app. Try to reboot and delete it again.
Press Ctrl + Shift + Esc to open Task Manager. Look for any processes that might be using the file. Right-click on the process and select End task. Attempt to delete the file again.
Open Command Prompt as administrator, navigate to the file location and use the del command followed by the file name to delete the file:

del filename.ext