Skip navigation

JSI Tip 6812. The sort order for files and folders whose name contains numeric characters has changed between Windows 2000 and Windows XP?

In Windows XP, files and folders with numeric characters are sorted like:

Ie4_01
Ie4_128
Ie5
Ie6
Ie401sp2
Ie501sp2
In Windows 2000, the same objects are sorted like:
Ie4_01
Ie4_128
Ie401sp2
Ie5
Ie501sp2
Ie6
NOTE: When windows XP encounters a numeric string, it uses the numeric value as apposed to the string value. Numeric 401 is greater than numeric 6.

Accordingly, See the following sort order:


Windows XP        Windows 2000
  5.txt             11.txt  
  11.txt            5.txt
  88.txt            88.txt
You can modify the Windows XP SP1 or greater sort order to be the same as it was for Windows 2000, by running XPSortOrder.bat.

The syntax for using XPSortOrder.bat is:

XPSortOrder all         - To effect all users of the Windows XP computer.

XPSortOrder user     - To effect the currently logged on user.

XPSortOrder.bat contains:

@echo off
setlocal
If \{%1\}==\{\} goto syntax
if /i "%1" EQU "user" set key=\[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\]&goto ok
if /i "%1" EQU "all" set key=\[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer\]&goto ok
:syntax
@echo Syntax: XPSortOrder all or XPSortOrder user
endlocal
goto :EOF
:ok
@echo REGEDIT4 >XPSortOrder.reg
@echo.>>XPSortOrder.reg
@echo %key%>>XPSortOrder.reg
@echo "NoStrCmpLogical"=dword:00000001>>XPSortOrder.reg
@echo.>>XPSortOrder.reg
regedit /s XPSortOrder.reg
del /q XPSortOrder.reg
endlocal
NOTE: See How can I toggle the Windows XP SP1 treatment of numerical values in the sort sequence?



Hide comments

Comments

  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.
Publish