How to delete an undeletable file?

Copper Contributor

My computer is running Windows 11 23H2 and I've got a file created by 7Zip located in C:\Temp (my C: drive is a Samsung 990 Pro SSD) where 7Zip crashed during the process of zipping files and now that file appears to be unable to be deleted. With Explorer run as administrator the file appears in the C:\Temp directory however when I attempt to delete it I get the message "Could not find this item" and "This is no longer located in C:\Temp. Verify the items location and try again". I've tried starting in safe mode with the same results, the file appears in File Explorer or in a command prompt using a dir command but attempts to delete it always come back with "The file is no longer located in etc etc". I've tried running "chkdsk /f" on my C: drive and then retrying both safe mode and normal startup and I can't delete that file (it's the only file in the directory) and I can't delete or rename the C:\Temp directory itself so how can I fix this problem?

1 Reply
I suggest to verify the owner of file. Most probably you would need to take ownership of that file to delete it.