HTFC Forums

H.T.F.C.

How To Fix Computers





Go Back   HTFC Forums > Software Newsgroups > Windows XP

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1  
Old 04-15-2008, 10:35 PM
Curt Dixon
 
Posts: n/a
Default Dir wildcards matching all extensions

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
Sponsored Links
Fix your Windows Problems - FAST.
FREE Safe Scan Registry Check. Locate & Fix Errors in Minutes!
  #2  
Old 04-15-2008, 10:52 PM
Holz
 
Posts: n/a
Default Re: Dir wildcards matching all extensions



On Tue, 15 Apr 2008 14:35:00 -0700
Curt Dixon <CurtDixon@discussions.microsoft.com> 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
  #3  
Old 04-15-2008, 11:26 PM
Ed Covney
 
Posts: n/a
Default Re: Dir wildcards matching all extensions

> 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
  #4  
Old 04-15-2008, 11:36 PM
Pegasus \(MVP\)
 
Posts: n/a
Default Re: Dir wildcards matching all extensions


"Curt Dixon" <CurtDixon@discussions.microsoft.com> wrote in message
news:E191D3E6-5E0E-464E-875C-D577784B84A9@microsoft.com...
> 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
  #5  
Old 04-16-2008, 12:00 AM
Curt Dixon
 
Posts: n/a
Default Re: Dir wildcards matching all extensions

"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
  #6  
Old 04-16-2008, 06:21 AM
Pegasus \(MVP\)
 
Posts: n/a
Default Re: Dir wildcards matching all extensions


"Curt Dixon" <CurtDixon@discussions.microsoft.com> wrote in message
news:0424B608-969C-4541-9928-E5057A68D0B7@microsoft.com...
> "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
Sponsored Links
Fix your Windows Problems - FAST.
FREE Safe Scan Registry Check. Locate & Fix Errors in Minutes!
Reply


Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Matching FSB and Memory Speeds Daddy Dell 12 01-19-2008 03:32 AM
Using wildcards in the C:\WINDOWS\system32\drivers\etc\HOSTS file? gaikokujinkyofusho@gmail.com Windows XP 2 11-27-2007 03:49 AM
Have RAM, need matching motherboard biggerdigger Homebuilt PC 10 09-20-2007 06:43 AM
matching almost identical photos Jar Jar Binks Digital Photo 5 08-06-2007 08:52 PM
Excel Matching on this column Howard Brazee Microsoft Office 0 05-10-2007 01:48 PM


All times are GMT. The time now is 04:30 PM.


Powered by vBulletin® Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0
© 2004 - 2007 Web-S-Sense Pty. Ltd. Usenet and forums posts © their respective authors.
Ad Management by RedTyger