Deleting a Stubborn File (Windows 10)

Using command prompt and the 8dot3 filename

2 min readDec 20, 2020

--

For some reason this file wont delete

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://answers.microsoft.com/en-us/windows/forum/all/how-to-delete-0-byte-files/95f71e27-bbe4-4bf0-9ea2-2c8527a41d80

https://www.youtube.com/watch?v=89wlEfRqa6U

https://superuser.com/a/45703

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

--

--

QM Learning
QM Learning

Written by QM Learning

0 Followers

QM Learning creates tutorials for professional documents and templates. We exist to inspire businesses, employees, students and the quality inclined!

No responses yet