Link to home
Start Free TrialLog in
Avatar of rogerfg7
rogerfg7

asked on

Explorer not sorting correctly

Windows 7 Explorer is not sorting files correctly.  I have sorted them by Name ascending and also done a DIR command,  Sort order is different.  Any ideas?
FileSort.png
SOLUTION
Avatar of Dan Craciun
Dan Craciun
Flag of Romania image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rogerfg7
rogerfg7

ASKER

Many thanks for your observation, I never thought of that.

But I want it to sort alphabetically (as per DOS) not numerically. MS too clever sometimes.

Does it also sort Month names in chronological order?
You can use the "Date Modified" or you the advance filter by clicking the drop down arrow.User generated image
No, it won't put March before December.
What I need to do now is modify my VS 2005 code in my application to sort them in the same order as Windows

I am using

file1.FilePath.CompareTo(file2.FilePath) in the IComparer Compare method.

Are there any inbuilt compare routines that act the same as Windows sort or do I write my own?

I guess this might be another post as it is now extending the topic.
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Just done an Internet search on this very topic and it seems the answer is 'write your own'.

Many thanks guys.  It's always the obvious that you miss!!
Why write your own???
StrCmpLogicalW is used by Windows Explorer to sort files. You can't get closer than that :)
There seems to be no equivalent available in .Net managed code

stackoverflow.com/questions/8793856/net-equivalent-of-strcmplogicalw