As in the linked thread, your problem is that the wildcard matches the additional name present on the files – the 8.3 "MS-DOS compatible" name.
Usually the "name" part is shortened by truncating it to 6 characters, then appending
~n with a numeric index (for example,
Program Files becomes
However, when the same folder has more than 3 files with identical 6-character prefixes (and the same extension), a different shortening method is used: the first two letters of the name are used, followed by four hexadecimal digits of the filename's CRC hash/checksum, followed by the
~n suffix. This ensures that the initial 6-character prefixes are spread somewhat evenly.
So when you run
dir apc*.*, that's two letters of the filename ("ap") and one digit of the CRC hash (hexadecimal digits are 0–9 A–F).
(Side note: "New-style" filenames no longer have a name/extension division, so it is enough to use
dir apc*. When Windows sees
.* at the end of a wildcard, it is simply ignored.)
What I read from that thread is that there is no final solution, since if you decide to remove the 8.3 names (bot on the system and in ALL files), Windows may be affected because some basic functions still work in 16 bit, and these would fail.
That hasn't been true for nearly two decades – Windows NT series has always been a fully 32-bit system in its core, with the 8.3 feature being there only for obsolete third-party software. (For that matter, the 64-bit amd64/x86_64 variants do not even have the ability to run 16-bit software.)
(I've also heard that recent Windows 10 releases no longer activate 8.3 name generation on new installations by default. Or was it newly formatted disks? Something like that.)
It is nowadays generally safe to strip 8.3 filenames on modern systems, and many guides recommend disabling 8.3 generation to improve the filesystem performance (especially on million-file folders). As a first step, you can disable just the future generation of such filenames and strip only C:\Temp\AEAPI, but keep the existing short names of all system files.
Alternatively you could move the "AEAPI" folder to a separate volume (disk partition) and disable 8.3 name generation only for that volume without risking the system volume in any way.
Alternatively, why doesn't have the DIR command a parameter to only show the "new style" name ? It has one to force the old one ( /X )
That's what it does by default. A regular
dir only shows the "new style" names.
The problem isn't with what it shows, but with what it finds. The command does not filter names itself; instead it asks the OS to find all names matching the wildcard. Because the additional 8.3 names have to work while opening a file, they have to work in all other operations, FindFirstFile/FindNextFile included.
There might be an opt-out flag some, but I suspect it would be process-wide rather than settable for individual operations.