Deleting files with empty extensions on Windows 8.1

I’m posting this here so I can find it more easily because this is at least the third time I had to google the issue to retrace my own steps on StackOverflow to find the solution I found last time! I even found some useful comments I wanted to upvote, only to realize they were my own from months ago! Argh!

So here’s the situation:

  • You somehow managed to create a file with an empty extension. One cannot normally do this, but one can do it thru e.g. the browser if one types a dot at the end of the filename. This creates two files, one without an extension and one with an empty extension:

pesky file 0

pesky file 1

  • If one tries to delete them the normal way, one gets “file not found” error for the one with a dot at the end:

pesky file 2

  • And even using del thru an elevated cmd does not work.

pesky file 3

  • Being sneaky with del *. does not work either.

pesky file 4

  • One has to use a special syntax that can deal with ill-formatted file names:

pesky file 5

AND DEAD!