cmd has wildcard bug? [duplicate]

Solution 1:

That's happening because the three question marks match the extension for the short version of the filename. Use

dir /x

to show (and work with) short versions of filenames.

Solution 2:

Concerning the problem of extensions longer than three characters: This is caused by the way how short file names are created. You can solve this by setting Win95TruncatedExtensions in the registry:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem]
"Win95TruncatedExtensions"=dword:00000000

Specifies whether NTFS and FAT generate file names for new files with the 8.3 naming convention.

Setting the value of this entry to 1 does not change any existing file name extensions, nor does it change the way these extensions are displayed or managed by Find, File Manager, or Windows Explorer. However, it causes NTFS and FAT to generate short names for new files, and to truncate the third character of file name extensions.

Default value is 1

enter image description here

But keep in mind this will effect only newly created or copied files.

(you might copy all files on your hard disk. You should do this registry setting as one of the first action when installing a Windows system.)