Surprising DIR results when using wildcard

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

Surprising DIR results when using wildcard

#1 Post by dbenham » 18 Nov 2011 19:54

I executed DIR TEST*2.BAT and found the following file
testAnyRtnN.bat :shock:

At first I couldn't figure out how a search pattern containing a 2 could return a file name that clearly does not contain a 2 . . .
. . . or does it? :twisted:

The file name exceeds the 8.3 standard - here is the short name:
TESTAN~2.BAT

Mystery solved. :D

Moral of the story - be careful when doing wildcard file searches. You may not get what you want :!:


Dave Benham

renzlo
Posts: 116
Joined: 03 May 2011 19:06

Re: Surprising DIR results when using wildcard

#2 Post by renzlo » 19 Nov 2011 06:32

thanks dave for the information.

Post Reply