Re: Weird file name sorting order in folder explorer window
- From: "Al Dunbar" <AlanDrub@xxxxxxxxxxxxxxxxxxx>
- Date: Mon, 31 Mar 2008 21:52:29 -0600
Totally bizarre. I very often sort files in explorer, often having explorer
configured to show common tasks rather than classic windows, and have never
noticed any such anomaly. I guess I just happen to use a naming convention
that does not cause the problem, as I have just confirmed the irrational
order, and it happens to me even in a newly created folder that has
defaulted to the classic style.
Thanks for the info, Keith. That KB article would seem to suggest that the
more recent versions try to sort filenames numerically, if at all possible.
Although we have all struggled in the past with finding files with names
like 8, 9, 10, 11 being sorted as 10,11,8,9. But just because a filename
contains a digit (even a leading one) does not mean that its creator wants
this kind of sorting.
Strangely enough, in the example Paul provides, the sort order seems truly
irrational, but repeatable. It is as if the leading digit causes a different
sorting method to operate, but one that, unfortunately, is incapable of
reverting to a character-based sort when it finds the filename to be other
than completely numeric.
I tried the same sequence with a non-hex letter prefixing the name, i.e.
"z00A*.txt" and etc, and it still resulted in the odd order. I then changed
all of the zeros to nines and the sort order became more rational. I then
changed the nens to eights and ran my file creation script again, and this
is how it sorts:
z8A88.txt
z9A99.txt
z88A8.txt
z99A9.txt
and etc. Now I'm getting dizzy...
/Al
" Keith Miller (MVP)" <k.miller@xxxxxxxxxxxxxxxx> wrote in message
news:eDoJcQ2kIHA.1368@xxxxxxxxxxxxxxxxxxxxxxx
Have you tried adding 'NoStrCmpLogical' REG_DWORD = 1 to either:
[HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer]
or
[HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer]
http://support.microsoft.com/kb/319827
--
Good Luck,
Keith
Microsoft MVP [Windows Shell/User]
"Paul Randall" <paulr901@xxxxxxxxxxxx> wrote in message
news:uBzPCv1kIHA.484@xxxxxxxxxxxxxxxxxxxxxxx
"Tom Lavedas" <tglbatch@xxxxxxx> wrote in message
news:8f7a28dc-7998-469a-a422-ed3d972b7398@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
On Mar 31, 1:08 pm, "Richard Mueller [MVP]" <rlmueller-
nos...@xxxxxxxxxxxxxxxxxxxx> wrote:
I see the same behaviour in Vista. I cannot make any sense out of it,
or see
any way to fix it.
--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab -http://www.rlmueller.net
--
"Paul Randall" <paulr...@xxxxxxxxxxxx> wrote in message
news:u$puAa0kIHA.1164@xxxxxxxxxxxxxxxxxxxxxxx
Hi,
I have a little project where I want the file names to be strings of
hexidecimal numbers, like 0000.txt and A000.txt. I want the user to
be
able to display the folder containing hundreds of these files in
view-details mode, sorted alphabetically, and easily find a
particular
file. With these hexidecimally named files, the sorting is weird and
unintuitive to me (I'd almost call the sorting dyslectic) , and any
particular file is difficult to find.
Question: Is there any scripting (or non-scripting) way to make a
folder
explorer window display the file names in plain ASCII ascending
order?
Example:
The following script creates 61 zero-byte text files:
Option Explicit
Dim i, j, sFileName
For j = 0 To 3
For i = 0 To 15
sFileName = Right("000" & Hex(i * (16 ^ j)), 4) & ".txt"
With CreateObject("Scripting.FileSystemObject")
.CreateTextFile(sFileName, True, False).Write("")
End With
Next 'i
Next 'j
MsgBox "All Done"
This creates one file named 0000.txt and four groups of 15 files with
a
single non-zero hexidecimal digit in column 4, 3, 2, and 1
respectively,
for a total of 61 files. The order in which they are created is the
order
in which they are sorted by the 'dir /on' command, and this is also
the
order I'd like to see them in the explorer window. A folder explorer
window sorts them differently, as follows:
0000.txt
00A0.txt
0A00.txt
000A.txt
same pattern of 3 files repeated for B, C, D, E, and F
0001.txt
0002.txt
...
0008.txt
0009.txt
same pattern of 9 files repeated with the non-zero numeric digit in
columns 3, 2, and 1.
A000.txt
B000.txt
C000.txt
D000.txt
E000.txt
F000.txt
I'm running WXP Pro SP2, but get the same bad results on WXP Home
with no
service packs or updates installed. Adding a fixed alphabetic
character
at the beginning or end of the file name does not change the weird
sorting
order. W98SE displays the files sorted properly in an explorer
window.
Thanks for any help you can give me.
-Paul Randall
My XPPSP2 system sorts it correctly. The only thing I can think of is
that I have it set to Windows Classic format (no web content in folder
display).
Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/
Tom & Richard,
Thanks for letting me know that my system isn't the problem and it is at
least possible to have WXP sort non-dyslexically. I tried manually
switching to classic folder view from control panel -> Folder Options
'Use Windows classic folders' on the general tab. That did not fix it,
but I haven't tried rebooting yet. I'd prefer not to have to reboot to
get the proper sort, and be able to easily get back the person's
preferences. I will play with it some more....
I've been messing with Unicode a little, and now I understand why the
order of the files listed at http://unicode.org/charts/PDF/?C=N;O=A seems
strange.
-Paul Randall
.
- Prev by Date: Re: MsgBox
- Next by Date: Re: MsgBox
- Previous by thread: Re: MsgBox
- Next by thread: Re: Weird file name sorting order in folder explorer window
- Index(es):
Relevant Pages
|