-- SR.DOC --
The SR.COM can be used in place of DOS rename and allows the renaming of
subdirectories and volume labels, as well as files.
One frustrating inconvenience of DOS 2.x is that it does not allow the
renaming of subdirectories and volume labels. The RENAME (alias REN)
command does not work on subdirectories or labels, so once a subdirectory
or volume has been created with a particular name, the only way to change
that name is to copy all files into a new directory or onto a new disk with
the desired name. This process can take a long time and it is certainly
impractical for changing a hard disk volume label.
Most DOS keyboard commands are also available as INT 21H function calls
from assembly language programs; two such function calls are offered for
renaming. Function 56H operates much as the RENAME command; it handles
path names, but will rename only normal files, not subdirectories or
volume labels. (This function differs from RENAME in that it accepts
two different path names and can move a file between directories without
copying the file contents.)
Function 17H accepts only file names, not path names, because it accesses
files by means of an FCB (File Control Block). It will rename directories
and labels as well as normal files, however, if it is provided with an
extended FCB containing the appropriate attribute value: 10H for
subdirectories, 08H for labels, and 18H for both of these.
SR uses function 17H to provide a "super-rename" feature that will change
the name of any file, subdirectory, or volume label. The name to be
changed must match the programs's first command-line parameter, and the
new name will be built up from the second parameter. If either parameter
is a volume label longer than eight character, a period must be inserted
after the eighth character.
Wild-card characters can be used in both original and new names, as long as
the guidelines documented under function 17H in the DOS manuals are followed.
To limit the processing to either subdirectories or volume labels, the value
at the symbol 'ATTR' should be changed to 10H (subdirectories) or 08H (volume
labels) - it might be useful to have two versions of the program. It is
important to note, however, that any version of the program may also be used
to rename normal files that match the first parameter.
SR can be implemented by entering it into an editor or word processor,
assembling it, linking it, and converting it to a .COM file with EXE2BIN;
the EXE version should not be run. The command
EXE2BIN SR SR.COM
can be used to create a .COM file directly from the .EXE version, without
going through a .BIN phase.
The source for SR was taken from short article appearing in the April 1985
issue of PC TECH Journal (pp. 41). The piece was authored by Ted Mirecki.
The source for SR in this implementation was keyed in by Terry Pearson and