Hello David,
Try adding a "/x" option to the "dir" commands to display the "short names" of the files. You will probably then see what is causing the unexpected matches.
Gary
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have run into some unexpected behavior with the Windows 10 DIR command. Specifically, if I include a numeral between wildcards when doing a directory search I get unexpected results.
For example, with the following files in a directory:
Directory of G:\TEST
10/15/2022 22:26 314 1.txt
10/15/2022 22:26 357 2.txt
10/15/2022 22:27 535 a b c.txt
10/15/2022 22:27 488 a b.txt
10/15/2022 22:26 400 a.txt
10/15/2022 22:28 731 abc def ghi.txt
10/15/2022 22:27 629 abc def.txt
10/15/2022 22:27 580 abc.txt
10/15/2022 22:27 678 abcdefg.txt
10/15/2022 22:30 789 abcdefghijklmnop.txt
10/15/2022 22:26 443 b.txt
if I type the command: DIR *1*
I would expect to get a single listing back - 1.txt
But instead I get this:
DIR *1*
10/15/2022 22:26 314 1.txt
10/15/2022 22:27 488 a b.txt
10/15/2022 22:27 629 abc def.txt
10/15/2022 22:27 535 a b c.txt
Similarly,
DIR *2*
10/15/2022 22:26 357 2.txt
10/15/2022 22:28 731 abc def ghi.txt
DIR *3*
10/15/2022 22:30 789 abcdefghijklmnop.txt
DIR *4*
File Not Found
DIR *5*
10/15/2022 22:27 488 a b.txt
and so on. I am not sure what this result is telling me. I have searched around on the web for documentation about some hidden feature in the DIR command that treats numerals between wildcards as some sort of special search parameter, but haven't found anything.
Does anyone know what is happening here?
Hello David,
Try adding a "/x" option to the "dir" commands to display the "short names" of the files. You will probably then see what is causing the unexpected matches.
Gary