PDB Helpdesk: Sorting File Displays|
By Thiravudh Khoman
Re: Andy Canfield's observation (Post Database, August 16, 2000) that it's not possible (or at least not easy) to physically sort files under Windows 98 using the likes of Norton Utilities' DS.EXE - he's probably right. Still, there IS a way to sort the display of files under DOS (under Windows proper there's little need for this, since you can often reverse sort a column of files by clicking the column header bar).
To get the DOS DIR command to sort files, simply add the following line to AUTOEXEC.BAT: SET DIRCMD=/O. This sorts files alphabetically by name, grouping directories first. You can also sort other ways - e.g. by file extension, by file date, by file size, by last access date, as well as perform reverse sorts. To view all the options, type: DIR /? and experiment with the /O options.