File Limit for DIR Command Sort Options

This article was previously published under Q100842
This article has been archived. It is offered "as is" and will no longer be updated.
When you use the DIR command with the /O switch at a command prompt,you may receive the following error message:
Too many files, directory not sorted
The directory listing is then displayed, but it is not sorted as yourequested.
There are more files in the directory than the command interpreter(COMMAND.COM) can sort. The maximum amount of memory that COMMAND.COM canallocate for a DIR operation is 64 kilobytes minus 512 bytes. Each filedisplayed by the DIR command requires 22 bytes for its entry, making thetotal number of files that can be displayed in a sorted directory equal to2295 files [(65536-512)/22].
Microsoft is researching this problem and will post new information herein the Microsoft Knowledge Base as it becomes available.
The MS-DOS DIR command is internal (built-in) to COMMAND.COM. The DIRcommand uses memory allocated by COMMAND.COM for its processing.
For more information about the DIR command and its sorting options, typedir /? at an MS-DOS command prompt.
5.00 5.00a 6.00 6.20 6.21 6.22

Article ID: 100842 - Last Review: 10/22/2013 20:24:02 - Revision: 2.0

Microsoft MS-DOS 5.0 Standard Edition, Microsoft MS-DOS 5.0a, Microsoft MS-DOS 6.0 Standard Edition, Microsoft MS-DOS 6.2 Standard Edition, Microsoft MS-DOS 6.21 Standard Edition, Microsoft MS-DOS 6.22 Standard Edition, Microsoft Windows 95

  • kbnosurvey kbarchive KB100842