PC Review


Reply
Thread Tools Rate Thread

dir sed*.* /s

 
 
Jim Carlock
Guest
Posts: n/a
 
      5th Aug 2008
First, I know this is not a Visual Basic question. And I do not
even know if this limited to only one machine. But I expected
the above to list files like sed.exe, sed342.exe, sed.txt and
so on. However, I ended up with some very odd results. I don't
think I've ever seen the "dir" command behave this way. I did
not see an XP cmd group and the Win2K cmd group does not seem
to get much attention.

C:\test\>dir sed*.* /s

When I typed that into a cmd.exe prompt on XP SP2, the following
were identified as matching files:

04/18/2004 06:00 PM 2,176 SetStaticByteField_3.cpp
04/18/2004 06:00 PM 2,158 SetStaticByteField_4.cpp
04/18/2004 06:00 PM 2,157 SetStaticByteField_1.cpp
04/18/2004 06:00 PM 2,178 SetStaticByteField_2.cpp

11/27/2001 03:59 PM 234 server-news-lock.gif
02/21/2004 04:16 PM 370 server-remote-lock-new.gif

Wondering if someone can duplicate that on Win2K or other versions
of XP?

Thank you for your time.

--
JC
Natural Cure For Pink-Eye (Conjunctivitis)
http://www.associatedcontent.com/art...nctivitis.html


 
Reply With Quote
 
 
 
 
Jeff Johnson
Guest
Posts: n/a
 
      5th Aug 2008
"Jim Carlock" <news@localhost> wrote in message
news:e640%(E-Mail Removed)...

> First, I know this is not a Visual Basic question. And I do not
> even know if this limited to only one machine. But I expected
> the above to list files like sed.exe, sed342.exe, sed.txt and
> so on. However, I ended up with some very odd results. I don't
> think I've ever seen the "dir" command behave this way. I did
> not see an XP cmd group and the Win2K cmd group does not seem
> to get much attention.
>
> C:\test\>dir sed*.* /s
>
> When I typed that into a cmd.exe prompt on XP SP2, the following
> were identified as matching files:
>
> 04/18/2004 06:00 PM 2,176 SetStaticByteField_3.cpp
> 04/18/2004 06:00 PM 2,158 SetStaticByteField_4.cpp
> 04/18/2004 06:00 PM 2,157 SetStaticByteField_1.cpp
> 04/18/2004 06:00 PM 2,178 SetStaticByteField_2.cpp
>
> 11/27/2001 03:59 PM 234 server-news-lock.gif
> 02/21/2004 04:16 PM 370 server-remote-lock-new.gif
>
> Wondering if someone can duplicate that on Win2K or other versions
> of XP?
>
> Thank you for your time.


More than likely the short (8.3) name starts with sed. I forgot what switch
you add to see that. /x?


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

"Jim Carlock" <news@localhost> wrote in message
news:e640%(E-Mail Removed)...
> First, I know this is not a Visual Basic question. And I do not
> even know if this limited to only one machine. But I expected
> the above to list files like sed.exe, sed342.exe, sed.txt and
> so on. However, I ended up with some very odd results. I don't
> think I've ever seen the "dir" command behave this way. I did
> not see an XP cmd group and the Win2K cmd group does not seem
> to get much attention.
>
> C:\test\>dir sed*.* /s
>
> When I typed that into a cmd.exe prompt on XP SP2, the following
> were identified as matching files:
>
> 04/18/2004 06:00 PM 2,176 SetStaticByteField_3.cpp
> 04/18/2004 06:00 PM 2,158 SetStaticByteField_4.cpp
> 04/18/2004 06:00 PM 2,157 SetStaticByteField_1.cpp
> 04/18/2004 06:00 PM 2,178 SetStaticByteField_2.cpp
>
> 11/27/2001 03:59 PM 234 server-news-lock.gif
> 02/21/2004 04:16 PM 370 server-remote-lock-new.gif
>
> Wondering if someone can duplicate that on Win2K or other versions
> of XP?
>
> Thank you for your time.
>
> --
> JC
> Natural Cure For Pink-Eye (Conjunctivitis)
> http://www.associatedcontent.com/art...nctivitis.html
>


As Jeff suggested, this happens because your SFNs start with "SED".
You will see this phenomenon when you have many files in the same
folders, forcing the SFN algorithm to go through lots of permutations.

You can avoid the problem by turning off SFN creation:
HKLM\SYSTEM\CurrentControlSet\Control\FileSystem value
NtfsDisable8dot3NameCreation


 
Reply With Quote
 
billious
Guest
Posts: n/a
 
      5th Aug 2008

"Jim Carlock" <news@localhost> wrote in message
news:e640%(E-Mail Removed)...
> First, I know this is not a Visual Basic question. And I do not
> even know if this limited to only one machine. But I expected
> the above to list files like sed.exe, sed342.exe, sed.txt and
> so on. However, I ended up with some very odd results. I don't
> think I've ever seen the "dir" command behave this way. I did
> not see an XP cmd group and the Win2K cmd group does not seem
> to get much attention.
>
> C:\test\>dir sed*.* /s
>
> When I typed that into a cmd.exe prompt on XP SP2, the following
> were identified as matching files:
>
> 04/18/2004 06:00 PM 2,176 SetStaticByteField_3.cpp
> 04/18/2004 06:00 PM 2,158 SetStaticByteField_4.cpp
> 04/18/2004 06:00 PM 2,157 SetStaticByteField_1.cpp
> 04/18/2004 06:00 PM 2,178 SetStaticByteField_2.cpp
>
> 11/27/2001 03:59 PM 234 server-news-lock.gif
> 02/21/2004 04:16 PM 370 server-remote-lock-new.gif
>
> Wondering if someone can duplicate that on Win2K or other versions
> of XP?
>
> Thank you for your time.
>
> --
> JC
> Natural Cure For Pink-Eye (Conjunctivitis)
> http://www.associatedcontent.com/art...nctivitis.html
>
>


If you're looking for an XP-oriented batch group, try alt.msdos.batch.nt -
or alt.msdos.batch (both are about the same nowadays...)

As for the problem - almost certainly finding short filenames. The short
filename seems to preserve the first two characters only reasonably
reliably. What follows id Hobson's choice - especially after the fourth
"reasonably similar" filename.

DIR /S will show the short-filename.


 
Reply With Quote
 
Jeff Johnson
Guest
Posts: n/a
 
      5th Aug 2008
"billious" <(E-Mail Removed)> wrote in message
news:48985cbf$0$3398$(E-Mail Removed)...

> DIR /S will show the short-filename.


Think you made a typo. /s is for subdirectories. Turns out I remembered
right and the switch is /x.


 
Reply With Quote
 
Monitor
Guest
Posts: n/a
 
      5th Aug 2008

"billious" <(E-Mail Removed)> wrote in message
news:48985cbf$0$3398$(E-Mail Removed)...
>
> "Jim Carlock" <news@localhost> wrote in message
> news:e640%(E-Mail Removed)...
> > First, I know this is not a Visual Basic question. And I do not
> > even know if this limited to only one machine. But I expected
> > the above to list files like sed.exe, sed342.exe, sed.txt and
> > so on. However, I ended up with some very odd results. I don't
> > think I've ever seen the "dir" command behave this way. I did
> > not see an XP cmd group and the Win2K cmd group does not seem
> > to get much attention.
> >
> > C:\test\>dir sed*.* /s
> >
> > When I typed that into a cmd.exe prompt on XP SP2, the following
> > were identified as matching files:
> >
> > 04/18/2004 06:00 PM 2,176 SetStaticByteField_3.cpp
> > 04/18/2004 06:00 PM 2,158 SetStaticByteField_4.cpp
> > 04/18/2004 06:00 PM 2,157 SetStaticByteField_1.cpp
> > 04/18/2004 06:00 PM 2,178 SetStaticByteField_2.cpp
> >
> > 11/27/2001 03:59 PM 234 server-news-lock.gif
> > 02/21/2004 04:16 PM 370 server-remote-lock-new.gif
> >
> > Wondering if someone can duplicate that on Win2K or other versions
> > of XP?
> >
> > Thank you for your time.
> >
> > --
> > JC
> > Natural Cure For Pink-Eye (Conjunctivitis)
> >

http://www.associatedcontent.com/art...nctivitis.html
> >
> >

>
> If you're looking for an XP-oriented batch group, try alt.msdos.batch.nt -
> or alt.msdos.batch (both are about the same nowadays...)
>
> As for the problem - almost certainly finding short filenames. The short
> filename seems to preserve the first two characters only reasonably
> reliably. What follows id Hobson's choice - especially after the fourth
> "reasonably similar" filename.
>
> DIR /S will show the short-filename.


I wonder why you bothered to answer. The short file name issue
was already covered by two previous respondents (to whom you
failed to give credit), and your own contributions were by and
large incorrect: Win2000.cmdprompt.admin IS an appropriate
newsgroup for asking questions about console commands, and
the /s switch, as Jeff pointed out, will not show the short file name.


 
Reply With Quote
 
JC
Guest
Posts: n/a
 
      5th Aug 2008
"Pegasus (MVP)" wrote:
>As Jeff suggested, this happens because your SFNs start with "SED".
>You will see this phenomenon when you have many files in the same
>folders, forcing the SFN algorithm to go through lots of permutations.
>
>You can avoid the problem by turning off SFN creation:
>HKLM\SYSTEM\CurrentControlSet\Control\FileSystem value
>NtfsDisable8dot3NameCreation


REG_DWORD value named NtfsDisable8dot3NameCreation with a value set to
0 or 1 the appropriate fix. It appears that the system needs a reboot
to activate this. Can anyone confirm a VB (or other code which might
get translated) way to force a registry reloading (I'm thinking the
quick suggestions might involve a logoff or some sort of automated
reboot). Just wondering if there's a way to get this done without doing
the logoff and/or reboot.

Thanks, Pegasus and Jeff. I looked for a switch to place in the
DIRCMD EV. Such a shame to not have one.

Thanks to 'billious' for suggesting other newsgroups (alt.msdos.batch
and alt.msdos.batch.nt).

--
JC
Natural Cure For Pink-Eye (Conjunctivitis)
http://www.associatedcontent.com/art...nctivitis.html


 
Reply With Quote
 
Bob Butler
Guest
Posts: n/a
 
      5th Aug 2008

"JC" <news@localhost> wrote in message
news:%(E-Mail Removed)...
> "Pegasus (MVP)" wrote:
>>As Jeff suggested, this happens because your SFNs start with "SED".
>>You will see this phenomenon when you have many files in the same
>>folders, forcing the SFN algorithm to go through lots of permutations.
>>
>>You can avoid the problem by turning off SFN creation:
>>HKLM\SYSTEM\CurrentControlSet\Control\FileSystem value
>>NtfsDisable8dot3NameCreation

>
> REG_DWORD value named NtfsDisable8dot3NameCreation with a value set to
> 0 or 1 the appropriate fix.


That's a pretty drastic "fix" that may interfere with operations on some
systems that expect or need the 8.3 names. It'd be better IMO to check the
results and skip any that don't match what you want.


 
Reply With Quote
 
billious
Guest
Posts: n/a
 
      5th Aug 2008

"Monitor" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> "billious" <(E-Mail Removed)> wrote in message
> news:48985cbf$0$3398$(E-Mail Removed)...
>>
>> "Jim Carlock" <news@localhost> wrote in message
>> news:e640%(E-Mail Removed)...
>> > First, I know this is not a Visual Basic question. And I do not
>> > even know if this limited to only one machine. But I expected
>> > the above to list files like sed.exe, sed342.exe, sed.txt and
>> > so on. However, I ended up with some very odd results. I don't
>> > think I've ever seen the "dir" command behave this way. I did
>> > not see an XP cmd group and the Win2K cmd group does not seem
>> > to get much attention.
>> >
>> > C:\test\>dir sed*.* /s
>> >
>> > When I typed that into a cmd.exe prompt on XP SP2, the following
>> > were identified as matching files:
>> >
>> > 04/18/2004 06:00 PM 2,176 SetStaticByteField_3.cpp
>> > 04/18/2004 06:00 PM 2,158 SetStaticByteField_4.cpp
>> > 04/18/2004 06:00 PM 2,157 SetStaticByteField_1.cpp
>> > 04/18/2004 06:00 PM 2,178 SetStaticByteField_2.cpp
>> >
>> > 11/27/2001 03:59 PM 234 server-news-lock.gif
>> > 02/21/2004 04:16 PM 370 server-remote-lock-new.gif
>> >
>> > Wondering if someone can duplicate that on Win2K or other versions
>> > of XP?
>> >
>> > Thank you for your time.
>> >
>> > --
>> > JC
>> > Natural Cure For Pink-Eye (Conjunctivitis)
>> >

> http://www.associatedcontent.com/art...nctivitis.html
>> >
>> >

>>
>> If you're looking for an XP-oriented batch group, try
>> alt.msdos.batch.nt -
>> or alt.msdos.batch (both are about the same nowadays...)
>>
>> As for the problem - almost certainly finding short filenames. The short
>> filename seems to preserve the first two characters only reasonably
>> reliably. What follows id Hobson's choice - especially after the fourth
>> "reasonably similar" filename.
>>
>> DIR /S will show the short-filename.

>
> I wonder why you bothered to answer. The short file name issue
> was already covered by two previous respondents (to whom you
> failed to give credit), and your own contributions were by and
> large incorrect: Win2000.cmdprompt.admin IS an appropriate
> newsgroup for asking questions about console commands, and
> the /s switch, as Jeff pointed out, will not show the short file name.
>
>


You seem to misunderstand the nature of the internet.

Simply because a post is made at a particular time does not mean that it is
visible at that time to everyone. There were no responses visible to me when
I replied.

win2000etc is an appropriate but ill-frequented group. The groups that I
mentioned are far more active - even if they don't have the magic
"microsoft" or "cmdprompt" as part of their names. Further, it was extra
information, seeing as neither of the other respondents whose responses I
hadn't seen hadn't mentioned them.

Certainly, the /S switch was a typo and should have been /X. Mea culpa. I
also typed "id" in place of "is." Mea maxima culpa.

But what else about what I said was "incorrect?"

The newsgroups?
That alt.msdos.batch and alt.msdos.batch.nt are about the same nowadays?
(See 'on-topic policy' comments of 22/8/08 in both groups)
Generation of short filenames? Well - that's based on empirical data. Try

for /l %i in (1,1,8) do dir>"this is a long filename%i.txt"

which should generate 8 filenames which will be "reasonably similar." On my
machine, here's the result of a dir/x :

06/08/08 01:41 4,355 THISIS~1.TXT this is a long filename1.txt
06/08/08 01:41 4,419 THISIS~2.TXT this is a long filename2.txt
06/08/08 01:41 4,483 THISIS~3.TXT this is a long filename3.txt
06/08/08 01:41 4,547 THISIS~4.TXT this is a long filename4.txt
06/08/08 01:41 4,611 TH18C2~1.TXT this is a long filename5.txt
06/08/08 01:41 4,675 TH18C6~1.TXT this is a long filename6.txt
06/08/08 01:41 4,739 TH28CA~1.TXT this is a long filename7.txt
06/08/08 01:41 4,803 TH28CE~1.TXT this is a long filename8.txt

Which, I believe, proves the point. The short filename retains the first 2
characters from the lfn in each case. For the first 4, the filename is the
first 6 non-space characters then a tilda and the sequence 1,2,3,4 - the
extent (or "secondary filename" if you're old enough to recognise that
terminology) is retained.
After the first four, the first two characters are followed by what is
apparently a hex code then ~1.

Or are you saying that DIR would not incorrectly report on the short
filenames?

So - what about my claims is "incorrect?"

And then I'll put the question back to you - why did you bother responding,
since you had nothing positive to contribute, only largely-incorrect
criticism and to repeat the indication of the error that you acknowledge had
already been detected?



 
Reply With Quote
 
JC
Guest
Posts: n/a
 
      5th Aug 2008
"Pegasus (MVP)" suggested:
>>You can avoid the problem by turning off SFN creation:
>>HKLM\SYSTEM\CurrentControlSet\Control\FileSystem value
>>NtfsDisable8dot3NameCreation


"JC" suggested in return...
> REG_DWORD value named NtfsDisable8dot3NameCreation with a value set to
> 0 or 1 the appropriate fix.


"Bob Butler" wrote...
: That's a pretty drastic "fix" that may interfere with operations on
: some systems that expect or need the 8.3 names. It'd be better IMO
: to check the results and skip any that don't match what you want.

Well, the verdict is in. It did NOT fix the problem. I rebooted the
system, confirmed the key was in place, as a DWORD value set to 1.

There's something more going on other than just that one key in the
registry. The hard disk drive is NTFS formatted, so perhaps the the
"Master" (?) file table does not adjust itself based upon that key.

Something else must be done, perhaps reformatting the drive? Yikes.
I'll defrag the drive tonight and see if that corrects it. Unless
someone else has another suggestion, I'm going to just forget about
the trouble for the time being. The proper thing would be to write
a VB application to find the files and then forget about the cmd
prompt. Someone else probably already wrote a file finding cmd-line
tool (maybe in unxutils). ls.exe seems to work properly and lists
file contents with sed*.* in it as well. It just is not listing the
folders in which they're located in.

C:\>ls.exe -R sed*.*

sed.exe sed414.chm sed414.exe sed414.hlp

sed=:
readme.txt sed.cmd sed.scr test.txt

C:\>

--
JC


 
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



Features
 

Advertising
 

Newsgroups
 


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