PC Review


Reply
Thread Tools Rate Thread

Dir wildcards matching all extensions

 
 
Curt Dixon
Guest
Posts: n/a
 
      15th Apr 2008
If I have files

test.tst
test.tst1
test.tst2

and I run "dir *.tst" at a cmd prompt, I get back all 3 files. Running "dir
*.ts?" and "dir *.t??" does the same thing. del works the same way (as
probably most wildcard cmds do).

This causes real problems if I want to delete all .res files but not .resx
files. Is there any way around this?
 
Reply With Quote
 
 
 
 
Holz
Guest
Posts: n/a
 
      15th Apr 2008


On Tue, 15 Apr 2008 14:35:00 -0700
Curt Dixon <(E-Mail Removed)> wrote:

>If I have files
>
>test.tst
>test.tst1
>test.tst2
>
>and I run "dir *.tst" at a cmd prompt, I get back all 3 files.
>Running "dir *.ts?" and "dir *.t??" does the same thing. del works
>the same way (as probably most wildcard cmds do).
>
>This causes real problems if I want to delete all .res files but
>not .resx files. Is there any way around this?


For all that I know Windows does no handle more then 3 characters file
extension.

--
Jerry Maguire: Help me... help you. Help me, help you.
;-)

 
Reply With Quote
 
Ed Covney
Guest
Posts: n/a
 
      15th Apr 2008
> For all that I know Windows does no handle more then 3 characters file
> extension.


Easy to test - change the file names
test.tst to test.ts
test.tst1 to test.ts1 and
test.tst2 to test.ts2

If it is now possible to distinguish the "*.ts", then indeed
Holz was spot-on (which he is).

Ed



 
Reply With Quote
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      15th Apr 2008

"Curt Dixon" <(E-Mail Removed)> wrote in message
news:E191D3E6-5E0E-464E-875C-(E-Mail Removed)...
> If I have files
>
> test.tst
> test.tst1
> test.tst2
>
> and I run "dir *.tst" at a cmd prompt, I get back all 3 files. Running
> "dir
> *.ts?" and "dir *.t??" does the same thing. del works the same way (as
> probably most wildcard cmds do).
>
> This causes real problems if I want to delete all .res files but not .resx
> files. Is there any way around this?


Unless you turn off the "Short File Name" (SFN) facility, all file
names have both an SFN and an LFN. Commands using a wild
card will produce a match if either the SFN or the LFN matches.

You will now find that the LFN extension of "test.tst1" is ".tst1".
The SFN extension for the same file ist ".tst". In other words,
there is a match for *.tst.

To see your SFNs, use this command:
dir /x


 
Reply With Quote
 
Curt Dixon
Guest
Posts: n/a
 
      16th Apr 2008
"Holz" wrote:
>
> For all that I know Windows does no handle more then 3 characters file
> extension.
>


Then change them to 4 chars.

test.test
test.test1
test.test2

Now "dir *.test" returns 1 file. "dir *.tes" returns all files.

There seems to be a special case bug when searching with 3 char extensions.
No doubt left over from the 1980's DOS days.
 
Reply With Quote
 
Pegasus \(MVP\)
Guest
Posts: n/a
 
      16th Apr 2008

"Curt Dixon" <(E-Mail Removed)> wrote in message
news:0424B608-969C-4541-9928-(E-Mail Removed)...
> "Holz" wrote:
>>
>> For all that I know Windows does no handle more then 3 characters file
>> extension.
>>

>
> Then change them to 4 chars.
>
> test.test
> test.test1
> test.test2
>
> Now "dir *.test" returns 1 file. "dir *.tes" returns all files.
>
> There seems to be a special case bug when searching with 3 char
> extensions.
> No doubt left over from the 1980's DOS days.


Nope. Not a bug - it's part of the SFN translation. Use dir /x
to see what I mean.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
String matching with wildcards Johnny Jörgensen Microsoft C# .NET 1 25th Sep 2007 12:00 PM
Search finds matching filenames but not files with matching content Richard Windows XP General 4 9th Sep 2006 01:33 AM
Email Rules - Wildcards in subject matching =?Utf-8?B?bG9jb3Rld3o=?= Microsoft Outlook Discussion 1 27th Feb 2006 02:11 AM
FP extensions versus SharePoint and latest version of FP extensions Fran Microsoft Frontpage 4 15th Mar 2005 04:33 PM
Finding matching/non-matching rows between two tables (same-but not updated). Mario Microsoft Access Queries 1 7th Aug 2003 01:36 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 09:15 PM.