The sort order for files and folders whose names contain numerals is different in Windows XP than it is in Windows 2000 (319827)



The information in this article applies to:

  • Microsoft Windows XP Home Edition
  • Microsoft Windows XP Professional
  • Microsoft Windows Server 2003, Standard Edition
  • Microsoft Windows Server 2003, Datacenter Edition
  • Microsoft Windows Server 2003, Web Edition
  • Microsoft Windows Server 2003 SP1

This article was previously published under Q319827
IMPORTANT: This article contains information about modifying the registry. Before you modify the registry, make sure to back it up and make sure that you understand how to restore the registry if a problem occurs. For information about how to back up, restore, and edit the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows Registry

SUMMARY

This article discusses the sort order that is used by Windows XP and Windows 2003 Server for files and folders whose names contain numerals, contains information about how the sort order in Windows XP and Windows 2003 Server is different from the sort order in Windows 2000, and describes how you can modify sort order behavior in Windows XP and Windows 2003 Server.

MORE INFORMATION

The sort order that is used by Windows XP and Windows 2003 Server for files and folders whose names contain numerals is different from the sort order that is used by Windows 2000. The following example shows the difference in sort order that is used by the two operating systems to list folders in Windows Explorer when the names of folders contain numerals:

In Windows XP and Windows 2003 Server:

Ie4_01
Ie4_128
Ie5
Ie6
Ie401sp2
Ie501sp2

In Windows 2000:

Ie4_01
Ie4_128
Ie401sp2
Ie5
Ie501sp2
Ie6

By default, in Windows XP and Windows 2003 Server numerals in strings that are contained in file and folder names are considered to be numeric content, not text. Numerals in folder and file names are sorted according to their numeric value.

In the example that is described earlier in this article, the Ie401sp2 folder is listed after the Ie6 folder when you sort the folders by name in descending order because 401 is a numerically higher value than 6. In the following example, note how the following files, whose names contain numerals, are sorted in Windows XP and Windows 2003 Server, and in Windows 2000:

In Windows XP and Windows 2003 Server:

5.txt
11.txt
88.txt

In Windows 2000:

11.txt
5.txt
88.txt

To Configure a Policy to Modify Sort Order in Windows XP or Windows 2003 Server

You can set a policy and configure Windows XP to use either the sort order that is used by Windows 2000 or the default Windows XP sort order. The policy settings are stored in the following registry values:

HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Currentversion\Policies\Explorer\NoStrCmpLogical

HKEY_CURRENT_USER\Software\Microsoft\Windows\Currentversion\Policies\Explorer\NoStrCmpLogical

To obtain this functionality, you must install the latest service pack for Windows XP. This functionality was first available in Windows XP Service Pack 1 (SP1). For additional information about how to obtain the latest service pack for Windows XP, click the following article number to view the article in the Microsoft Knowledge Base:

322389 How to Obtain the Latest Windows XP Service Pack



After you install Windows XP Service Pack 1 or later, create the NoStrCmpLogical registry value and configure the policy. To do so:

WARNING: If you use Registry Editor incorrectly, you may cause serious problems that may require you to reinstall your operating system. Microsoft cannot guarantee that you can solve problems that result from using Registry Editor incorrectly. Use Registry Editor at your own risk.
  1. Click Start, and then click Run.
  2. In the Open box, type regedit, and then click OK.
  3. Do one of the following, as appropriate to your situation:
    • To configure the policy for all users of the computer, locate, and then click the following registry key:

      HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\Currentversion\Policies\Explorer

      -or-
    • To configure the policy for the current user, locate, and then click the following registry key:

      HKEY_CURRENT_USER\Software\Microsoft\Windows\Currentversion\Policies\Explorer

  4. On the Edit menu, point to New, and then click DWORD Value
  5. Type NoStrCmpLogical, and then press ENTER.
  6. On the Edit menu, click Modify.
  7. To set the sort order that you want to use for files and folders whose names contain numerals, do one of the following, as appropriate to your situation:
    • To configure Windows XP or Windows 2003 Server to use the method that Windows 2000 uses for sorting files and folders, in the Value data box, type 1, and the click OK.


      -or-
    • To configure the default Windows XP or Windows 2003 Server method for sorting files and folders, in the Value data box, type 0, and then click OK.

      Note When the NoStrCmpLogical value does not exist or when it is set to 0 (zero), the default Windows XP sort order is used.
  8. Quit Registry Editor, and then restart the computer.

Modification Type:MinorLast Reviewed:9/27/2005
Keywords:kbHotfixServer kbQFE kbfix kbbug KB319827 kbAudEndUser kbAudITPRO