Hi there,
I have a lot of files in a folder
I run the following to get a subset
dir /b pa1*.txt
I would expect this to bring back only files like
pa1.txt
pa11.txt etc
However it also brings back files like
pay1.txt
Any reason for this does any one know
Dir with wildcard returning unexpected result
Moderator: DosItHelp
Re: Dir with wildcard returning unexpected result
It is matching the short file names. 8.3.
Run the DIR command from a command prompt and use the /X option to see what I mean.
Run the DIR command from a command prompt and use the /X option to see what I mean.
Re: Dir with wildcard returning unexpected result
I'm not using the short name format.
I tried with the /X and i still get filenames I dont want
I tried with the /X and i still get filenames I dont want
Re: Dir with wildcard returning unexpected result
Never said you were using short file names nor did I say using /X would solve your problem. I am saying the default behavior is that the WILDCARD will also match short file names.
The EXAMPLE your provided does not output what you say it does because the file names you provided are already in 8.3 format. Don't ever post an example without testing it first.
Go back to the directory that you are having problems with. When you run the DIR command with the /X option you should see that the short file names are matching your search mask.
Re: Dir with wildcard returning unexpected result
Sorry
I understand what you mean now.
Can I exclude these?
I understand what you mean now.
Can I exclude these?