home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
utility
/
pbaseiv.zip
/
P4DOS012.TIP
< prev
next >
Wrap
Text File
|
1991-12-16
|
2KB
|
50 lines
I need to list files by name, extension, size, date, or
time. To make this simple, I wrote DS.BAT [see listing]. The
program uses the DOS SORT filter's /+n parameter to specify
a beginning column for sorting.
Run the program by typing ds, followed by an optional file
specification with wild cards, and either n for name order,
e for extension, s for size, d for date, or t for time. You
may type commands in either uppercase or lowercase. For
example, ds c:\S123\S*.wks d lists by date all WKS files in
the C:\S123 directory, while ds e displays by extension all
files in the current directory. A simple ds lists by name
all files in the current directory.
DS.BAT uses environment variables to store file
specifications and sort-key column positions. If environment
space is low, the program may not work correctly.
Derek E. Houseworth
Bozeman, Montana
Editor's note: While all of DS.BAT's parameters are
optional, you can't use the first (the file specification)
without the second (the sort order). The command ds *.bat
will list all of your files by file name; for BAT files
only, type ds *.bat n.
If you have trouble using DS, you may have to insert a line
such as SHELL=COMMAND.COM /E:512 /P in CONFIG.SYS. Change
512 to a greater number in order to reserve more bytes for
environment variables. The /P option, which stands for
"permanent," is needed for DOS to run AUTOEXEC.BAT.
Postscript: This tip was improved upon in "A Better Sort of
Sort" (July 1991), which appears as another item on the DOS
menu in PowerBase *.* Volume IV. Use the listing in that tip
if you'd like to run DS.BAT. But it's worth noting that
since both tips were published, MS-DOS 5.0 came out; it
solves the problem once and for all with a built-in sort
switch in the DIR command. The /O:<order> switch lets you
sort a listing forward or backward by date and time, size,
name, and extension. Thus, DS.BAT is only of use to you if
you haven't upgraded to DOS 5.
Title: Sort of a Directory
Category: DOS
Issue date: Mar 1991
Editor: Tom Swan
Supplementary files: NONE