Deleting a Stubborn File (Windows 10)
Using command prompt and the 8dot3 filename
Why won’t it delete
Earlier today I made the terrible mistake of cancelling a video compile, resulting in a program crash. This left a cluster of temporary files on my C:\ drive. I always worry when pressing the cancel button, and this time Windows didn’t disappoint.
I tried to delete the unwanted files but one proved a challenge. The file had no extension and a size of zero bytes. A quick check of the parent folder showed an unexplained 2gb. I was unable to rename the folder because according to windows the file didn’t exist. Time to hit google.
Fortunately I stumbled across this forum with links to a helpful YouTube video. Below is a summary of the steps:
Step 1: Open the command prompt and navigate to the parent folder using the ‘cd’ command.
Step 2: List all files & folders within the directory using the ‘dir’ command, displaying 8dot3 filenames using the /x parameter.
Step 3: Delete the recalcitrant file using the 8dot3 filename and the ‘del’ command.
Bonus: To delete a stubborn folder use the ‘rd’ command and the /s parameter
Sources:
https://www.youtube.com/watch?v=89wlEfRqa6U
https://en.wikipedia.org/wiki/8.3_filename
Command prompt
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cd
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/dir
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/del
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/rd