Contents of the BATCD.DOC file
This program allows a batch file to change directories (just
like the CD command), but to read the new directory from the
"standard input file" instead of the command line.
BATCD reads new directory from keyboard
BATCD < file reads new directory from "file"
BATCD < file > nul no display of new dir name when changing
You can use the directory changer to change back to the directory a
batch file started out with, such as when doing a spelling correction
or fancy font printing.
. (your batch file to do fancy font from any directory)
cd > \bin\bat\starting.dir saves initial directory
copy %1 \fancyfnt\temp/v make file local to pfont dir
cd \fancyfnt go to pfont dir
pfont +fi temp +fo romn12 (etc.) do printing
del temp get rid of local file copy
batcd <\bin\bat\starting.dir >nul return to user's directory
If you were going to, for example, a speller directory, which made
changes to the file, then you would copy the local file back before
changing directories back:
cd >\bin\bat\starting.dir save initial directory
copy %1 \speller\temp.txt/v make your file local
batcd <\bin\bat\starting.dir >nul change back to user's dir
copy \speller\temp.txt %1/v copy spelling corrected file
del \speller\temp.txt back & delete other copy
Note that the new input is read as a single line, without any prompt,
followed by a carriage return. If the input is not a valid directory,
then the message "path not found" is placed on the standard output
file (console, but redirectable if one wishes).
then the message