Windows Explorer not sorting files correctly

C

Conan Kelly

Hello all,

I have a folder on a network share that has the following files in it sorted by Name:

05312006DD.txt

05312006NIBDD.txt

05312006NIBSA.txt

05312006SA.txt

06302006DD.txt

06302006NIBDD.txt

06302006NIBSA.txt

06302006SA.txt

07312006DD.txt

07312006NIBDD.txt

07312006NIBSA.txt

07312006SA.txt

053120062DD.txt

063020062DD.txt

073120062DD.txt

RE follow up.htm



Notice the 3 text files at the bottom. They are out of order. They appear to start with a zero rather than the letter O.



When I sort by Type, this is the order they are in:



RE follow up.htm

05312006DD.txt

05312006NIBDD.txt

05312006NIBSA.txt

05312006SA.txt

06302006DD.txt

06302006NIBDD.txt

06302006NIBSA.txt

06302006SA.txt

07312006DD.txt

07312006NIBDD.txt

07312006NIBSA.txt

07312006SA.txt

053120062DD.txt

063020062DD.txt

073120062DD.txt



the 3 bottom text files are still out of order.



When I run the following 2 samples of code in Word and Excel, the results are the same:



'MS Word

Sub TESTING()
Dim fso As New FileSystemObject
Dim fsoFolder As Folder
Dim fsoFile As File

Set fsoFolder = fso.GetFolder("X:\FolderName\SubFolderName")

For Each fsoFile In fsoFolder.Files
Selection.TypeText fsoFile.Name
Selection.TypeParagraph
Next fsoFile
End Sub





'MS Excel

Sub TESTING()
Dim fso As New FileSystemObject
Dim fsoFolder As Folder
Dim fsoFile As File

Set fsoFolder = fso.GetFolder("X:\FolderName\SubFolderName")

For Each fsoFile In fsoFolder.Files
ActiveCell = fsoFile.Name
Cells(ActiveCell.Row + 1, ActiveCell.Column).Select
Next fsoFile
End Sub



Here is the results:



053120062DD.txt

05312006DD.txt

05312006NIBDD.txt

05312006NIBSA.txt

05312006SA.txt

063020062DD.txt

06302006DD.txt

06302006NIBDD.txt

06302006NIBSA.txt

06302006SA.txt

073120062DD.txt

07312006DD.txt

07312006NIBDD.txt

07312006NIBSA.txt

07312006SA.txt

RE follow up.htm





I even went as far as doing this in Excel:



Cell A1:

053120062DD.txt '<---Copied the file name into it from Windows Explorer



Cell B1:

=CODE(A1)



Cell A2:

=RIGHT(A1,LEN(A1)-1)



Cell B2:

=CODE(A2)



Now I selected the range A2:B2 and filled that down until I ran out of letters in the file name. The codes for the first character
in the file name and the 2 zeros in the year were all 48. After that I copied one of the file names of the files that are in order
to cell A1 and got the same results: the first character and the 2 zero's have the same code.



Anyone have any idea as to why Windows Explorer is sorting these files this way?



Thanks for any help anyone can provide,


Conan Kelly
 
W

Wesley Vogel

Use TweakUI

TweakUI
[+] Explorer
Use intuitive filename sorting

[[If this is checked the Explorer will sort files so that, for e.g. “File 5”
comes before “File 10” because 5 comes before 10. If this is unchecked then
Explorer will use literal sorting, in which case “File 10” will come before
“File 5” because 1 comes before 5. ]]
----

Download TweakUI here >>>

Microsoft PowerToys for Windows XP
http://www.microsoft.com/windowsxp/pro/downloads/powertoys.asp

Tweak UI
TweakUI.exe

The Sort Order for Files and Folders Whose Names Contain Numerals Is
Different in Windows XP Than It Is in Windows 2000
http://support.microsoft.com/default.aspx?scid=kb;en-us;319827

Windows Explorer Incorrectly Sorts Files and Folders with 10 or
More Consecutive Numerals
http://support.microsoft.com/default.aspx?scid=kb;en-us;318872

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
G

Guest

Is there a way to change the way Windows Explorer sorts files without
changing the registry or using TweakUI? I can't get TweakUi to open.

I'd like to sort:

056601
0566A1
0566R1
0566R1A1

Wesley Vogel said:
Use TweakUI

TweakUI
[+] Explorer
Use intuitive filename sorting

[[If this is checked the Explorer will sort files so that, for e.g. “File 5â€
comes before “File 10†because 5 comes before 10. If this is unchecked then
Explorer will use literal sorting, in which case “File 10†will come before
“File 5†because 1 comes before 5. ]]
----

Download TweakUI here >>>

Microsoft PowerToys for Windows XP
http://www.microsoft.com/windowsxp/pro/downloads/powertoys.asp

Tweak UI
TweakUI.exe

The Sort Order for Files and Folders Whose Names Contain Numerals Is
Different in Windows XP Than It Is in Windows 2000
http://support.microsoft.com/default.aspx?scid=kb;en-us;319827

Windows Explorer Incorrectly Sorts Files and Folders with 10 or
More Consecutive Numerals
http://support.microsoft.com/default.aspx?scid=kb;en-us;318872

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
Conan Kelly said:
Hello all,

I have a folder on a network share that has the following files in it
sorted by Name:

05312006DD.txt

05312006NIBDD.txt

05312006NIBSA.txt

05312006SA.txt

06302006DD.txt

06302006NIBDD.txt

06302006NIBSA.txt

06302006SA.txt

07312006DD.txt

07312006NIBDD.txt

07312006NIBSA.txt

07312006SA.txt

053120062DD.txt

063020062DD.txt

073120062DD.txt

RE follow up.htm



Notice the 3 text files at the bottom. They are out of order. They
appear to start with a zero rather than the letter O.



When I sort by Type, this is the order they are in:



RE follow up.htm

05312006DD.txt

05312006NIBDD.txt

05312006NIBSA.txt

05312006SA.txt

06302006DD.txt

06302006NIBDD.txt

06302006NIBSA.txt

06302006SA.txt

07312006DD.txt

07312006NIBDD.txt

07312006NIBSA.txt

07312006SA.txt

053120062DD.txt

063020062DD.txt

073120062DD.txt



the 3 bottom text files are still out of order.



When I run the following 2 samples of code in Word and Excel, the results
are the same:



'MS Word

Sub TESTING()
Dim fso As New FileSystemObject
Dim fsoFolder As Folder
Dim fsoFile As File

Set fsoFolder = fso.GetFolder("X:\FolderName\SubFolderName")

For Each fsoFile In fsoFolder.Files
Selection.TypeText fsoFile.Name
Selection.TypeParagraph
Next fsoFile
End Sub





'MS Excel

Sub TESTING()
Dim fso As New FileSystemObject
Dim fsoFolder As Folder
Dim fsoFile As File

Set fsoFolder = fso.GetFolder("X:\FolderName\SubFolderName")

For Each fsoFile In fsoFolder.Files
ActiveCell = fsoFile.Name
Cells(ActiveCell.Row + 1, ActiveCell.Column).Select
Next fsoFile
End Sub



Here is the results:



053120062DD.txt

05312006DD.txt

05312006NIBDD.txt

05312006NIBSA.txt

05312006SA.txt

063020062DD.txt

06302006DD.txt

06302006NIBDD.txt

06302006NIBSA.txt

06302006SA.txt

073120062DD.txt

07312006DD.txt

07312006NIBDD.txt

07312006NIBSA.txt

07312006SA.txt

RE follow up.htm





I even went as far as doing this in Excel:



Cell A1:

053120062DD.txt '<---Copied the file name into it from Windows
Explorer



Cell B1:

=CODE(A1)



Cell A2:

=RIGHT(A1,LEN(A1)-1)



Cell B2:

=CODE(A2)



Now I selected the range A2:B2 and filled that down until I ran out of
letters in the file name. The codes for the first character in the file
name and the 2 zeros in the year were all 48. After that I copied one of
the file names of the files that are in order to cell A1 and got the same
results: the first character and the 2 zero's have the same code.



Anyone have any idea as to why Windows Explorer is sorting these files
this way?



Thanks for any help anyone can provide,


Conan Kelly
 
B

Bob I

Since the registry entry determines the sort order method, no.

Mike said:
Is there a way to change the way Windows Explorer sorts files without
changing the registry or using TweakUI? I can't get TweakUi to open.

I'd like to sort:

056601
0566A1
0566R1
0566R1A1

:

Use TweakUI

TweakUI
[+] Explorer
Use intuitive filename sorting

[[If this is checked the Explorer will sort files so that, for e.g. “File 5â€
comes before “File 10†because 5 comes before 10. If this is unchecked then
Explorer will use literal sorting, in which case “File 10†will come before
“File 5†because 1 comes before 5. ]]
----

Download TweakUI here >>>

Microsoft PowerToys for Windows XP
http://www.microsoft.com/windowsxp/pro/downloads/powertoys.asp

Tweak UI
TweakUI.exe

The Sort Order for Files and Folders Whose Names Contain Numerals Is
Different in Windows XP Than It Is in Windows 2000
http://support.microsoft.com/default.aspx?scid=kb;en-us;319827

Windows Explorer Incorrectly Sorts Files and Folders with 10 or
More Consecutive Numerals
http://support.microsoft.com/default.aspx?scid=kb;en-us;318872

--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
Conan Kelly said:
Hello all,

I have a folder on a network share that has the following files in it
sorted by Name:

05312006DD.txt

05312006NIBDD.txt

05312006NIBSA.txt

05312006SA.txt

06302006DD.txt

06302006NIBDD.txt

06302006NIBSA.txt

06302006SA.txt

07312006DD.txt

07312006NIBDD.txt

07312006NIBSA.txt

07312006SA.txt

053120062DD.txt

063020062DD.txt

073120062DD.txt

RE follow up.htm



Notice the 3 text files at the bottom. They are out of order. They
appear to start with a zero rather than the letter O.



When I sort by Type, this is the order they are in:



RE follow up.htm

05312006DD.txt

05312006NIBDD.txt

05312006NIBSA.txt

05312006SA.txt

06302006DD.txt

06302006NIBDD.txt

06302006NIBSA.txt

06302006SA.txt

07312006DD.txt

07312006NIBDD.txt

07312006NIBSA.txt

07312006SA.txt

053120062DD.txt

063020062DD.txt

073120062DD.txt



the 3 bottom text files are still out of order.



When I run the following 2 samples of code in Word and Excel, the results
are the same:



'MS Word

Sub TESTING()
Dim fso As New FileSystemObject
Dim fsoFolder As Folder
Dim fsoFile As File

Set fsoFolder = fso.GetFolder("X:\FolderName\SubFolderName")

For Each fsoFile In fsoFolder.Files
Selection.TypeText fsoFile.Name
Selection.TypeParagraph
Next fsoFile
End Sub





'MS Excel

Sub TESTING()
Dim fso As New FileSystemObject
Dim fsoFolder As Folder
Dim fsoFile As File

Set fsoFolder = fso.GetFolder("X:\FolderName\SubFolderName")

For Each fsoFile In fsoFolder.Files
ActiveCell = fsoFile.Name
Cells(ActiveCell.Row + 1, ActiveCell.Column).Select
Next fsoFile
End Sub



Here is the results:



053120062DD.txt

05312006DD.txt

05312006NIBDD.txt

05312006NIBSA.txt

05312006SA.txt

063020062DD.txt

06302006DD.txt

06302006NIBDD.txt

06302006NIBSA.txt

06302006SA.txt

073120062DD.txt

07312006DD.txt

07312006NIBDD.txt

07312006NIBSA.txt

07312006SA.txt

RE follow up.htm





I even went as far as doing this in Excel:



Cell A1:

053120062DD.txt '<---Copied the file name into it from Windows
Explorer



Cell B1:

=CODE(A1)



Cell A2:

=RIGHT(A1,LEN(A1)-1)



Cell B2:

=CODE(A2)



Now I selected the range A2:B2 and filled that down until I ran out of
letters in the file name. The codes for the first character in the file
name and the 2 zeros in the year were all 48. After that I copied one of
the file names of the files that are in order to cell A1 and got the same
results: the first character and the 2 zero's have the same code.



Anyone have any idea as to why Windows Explorer is sorting these files
this way?



Thanks for any help anyone can provide,


Conan Kelly
 
Top