Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How in the world does Windows File Explorer sort by name? [closed]

Just once I'd like someone from Microsoft to say, "That seems weird. It looks like you might lose your files. I'll log a bug for that."

In what universe does 5 come before 4?

like image 761
Mike Layton Avatar asked Oct 18 '25 04:10

Mike Layton


1 Answers

Courtesy @RaymondChen's Windows Confidential: The Evolution of Sorting:

...when Windows 95 sorted file names for display in Windows Explorer, it would put file139 ahead of file20. This is perfectly logical from a computer programmer’s point of view. It’s also completely counter-intuitive to normal human beings—thus proving that computer programmers are not normal human beings.

In Windows XP, Microsoft updated the Windows Explorer sorting algorithm to be more in line with what normal human beings expect. It treated digits in file names as numbers instead of sequences of characters. While this improved sorting for most people, there were cases where this change resulted in some surprises.

One example that recurred frequently was file names containing hex values. Under the new number-based sorting, Windows Explorer assumed that a file named “1040A” should sort slightly after “1040,” and nowhere near a file named “103F2.” If for whatever reason you’re in the habit of viewing folders full of files whose names are hex values, you can set the policy “Turn off numerical sorting in Windows Explorer.” This policy changes sorting back to the way it was in versions of Windows prior to Windows XP—namely, character-by-character.

Ironically enough, this was known as "intuitive file sorting" when the feature was introduced back in Windows XP. It can be turned off by setting local policies (as highlighted above) or by editing the registry - see How to Enable or Disable Numerical Sorting in Windows Explorer.

like image 124
dxiv Avatar answered Oct 20 '25 20:10

dxiv