Fun with wildcards and DOS 8.3 filenames

I’ve found under some circumstances, new versions of Windows (XP and 2000, using NTFS) are still looking at the DOS 8.3 versions of filenames when using wildcards.

Real world example: a set of files such as tpo12345.xml tpo12346.xml tpo12347.xml etc. To find these, you’d use a wildcard such as tpo?????.xml

If you have a file called tpo1234567890.xml, it shouldn’t match using this wildcard, but it does, because the filename’s backward-compatible short version (in DOS 8.3 format) is something like TPO123~1.XML, which matches. It appears to only happen when the first part of the wildcard (without the suffix) is 8 characters long.

So it may be ten years since most of us said goodbye to short filenames, but it seems they’re still with us. I wonder if Windows Vista will still use them?

1 thought on “Fun with wildcards and DOS 8.3 filenames

Comments are closed.