Re: Weird file name sorting order in folder explorer window
- From: Tom Lavedas <tglbatch@xxxxxxx>
- Date: Mon, 31 Mar 2008 11:05:46 -0700 (PDT)
On Mar 31, 1:36 pm, Tom Lavedas <tglba...@xxxxxxx> wrote:
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/
Actually, I was able to get it to mess up. I changed the display from
Detail to Icon a in non-classic mode snd everything went berserk. The
only thing that I could do to restore order was to delete the folder
and recreate it in my standard for all folders - Details. Then it was
sorted correctly. It seems to be a bug in the non-classic formatted
window when any change is made. But operation in the Windows classic
mode does not create any problems. However, once it is messed up
switching into classic mode does not fix the problem. Once the order
is corrupted, it appears to be permanent. I guess it's related to a
registry setting.
Tom Lavedas
===========
http://members.cox.net/tglbatch/wsh/
.
- References:
- Weird file name sorting order in folder explorer window
- From: Paul Randall
- Re: Weird file name sorting order in folder explorer window
- From: Richard Mueller [MVP]
- Re: Weird file name sorting order in folder explorer window
- From: Tom Lavedas
- Weird file name sorting order in folder explorer window
- Prev by Date: Re: Weird file name sorting order in folder explorer window
- Next by Date: Re: Weird file name sorting order in folder explorer window
- Previous by thread: Re: Weird file name sorting order in folder explorer window
- Next by thread: Re: Weird file name sorting order in folder explorer window
- Index(es):
Relevant Pages
|