home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
RBBS in a Box Volume 1 #2
/
RBBS_vol1_no2.iso
/
011z
/
stdbatch.doc
< prev
next >
Wrap
Text File
|
1987-01-03
|
9KB
|
272 lines
Dear Vern,
This document talks about hard disk management using the
facilities provided by DOS.
CONFIG.SYS
In order to privide some of the capabilities for batch files
listed below, the following two lines should be added to your
CONFIG.SYS file.
DEVICE=C:\PATH\ANSI.SYS
LASTDRIVE=Z
The file ANSI.SYS, which is on the main DOS diskette, must be
available within the directory given at PATH above. I have all my
DOS files in the directory C:\DOS so the command line in my file
is: DEVICE=C:\DOS\ANSI.SYS. This line increases the size of DOS in
memory by 1651 bytes. This is the extended screen and keyboard
control device and provides for the use of special control character
sequences which will be used below.
Several lines are needed in the AUTOEXEC.BAT file to set up the
environment. First, the line
PATH C:\BATCH;C:\DOS
causes DOS to search the current directory and the two given in the
command line for commands or batch files. The directory C:\BATCH
contains those files which call all of my programs and manages both
the subdirectories and, if required, special envirement data. These
use of these is best described through the examples given below. The
second directory: C:\DOS, is included because I find it convenient
to access the DOS files without changing the active directory.
The second line:
PROMPT $e[s$e[H$e[K$e[7m$p$e[5C$d$e[0m$e[u-
causes the current directory and date to be displayed on the top
line and the DOS prompt to be a '-'. In order of appearance the code
is: $e[s saves the current cursor position, $e[H moves the cursor
the home position, $e[K erases from the cursor to the end of the
line, $e[7m sets the character attribute to reverse video, $p
displays the current directory of the default drive, $e[5C moves the
cursor forward 5 columns, $d displays the date, $e[0m sets the
character attributes off (norman white on black), $e[u restores the
cursor to the value saved above, and the final - sets the DOS
prompt to -. I find this handy since the current directory is
displayed at the top of the screen when the operating system is in
control.
The next line(s) allow different drive designators to refer to
specified directories:
SUBST F: C:\DATA\FINANCE
SUBST G: C:\DATA\GENERAL
SUBST L: C:\APPLDVLP\SRC_CODE\LISP
SUBST M: C:\DATA\MASTERS
SUBST P: C:\APPLDVLP\SRC_CODE\PASCAL
SUBST S: C:\DATA\SCOUTING
For example, after these assignments, the command line
DIR F:*.DOC | SORT
would provide a sorted list of the files in the C:\DATA\FINANCE
directory with the extension DOC. You don't need the path for SORT
if the PATH command above is included in the AUTOEXEC.BAT file. In
addition to this, I've found that programs which do not allow path
names (at least thoses which I've used) work fine with a drive
designator as define above.
By the way, the line
DIR F:*.DOC | SORT > D:DIRECTRY.LST
would put the sorted list in a file of the name DIRECTRY.LST on
drive D, a virtual drive on my system.
Now for some sample batch files which provide for access to
programs as well as management of your subdirectories. The batch
files below were written in PC-Write, an ASCII file editor and may
not print properly with a non-ASCII editor because of the embedded
ASCII extension characters.
NAME: LIST.BAT (for color)
ECHO OFF
C:\DOS\MODE CO80
ECHO
CLS
REM This batch file provides a list of the available batch files and briefly
REM describes each file's purpose.
ECHO
ECHO
ECHO Batch File Command List
ECHO
ECHO
BKUP
- Fixed Disk File Back Up
ECHO
ECHO
CK
- Spelling Checker
ECHO
ECHO
DB
- DBase III Data Base Program
ECHO
ECHO
ED
- PC-Write Text Processor
ECHO
ECHO
INDX
- Index of Drive Designators
ECHO
ECHO
PM
- Havard Total Project Manager
ECHO
ECHO
PRNT
- Print a Queue of Data Files
ECHO
ECHO
QUIT
- Return to Batch File List
ECHO
ECHO
SS
- 123 Spreadsheet Program
ECHO
ECHO
TLK
- PC-Talk Communications Prog.
The embedded extended ASCII characters, above and following,
use the extended screen capabilites provided by the ANSI.SYS driver.
NAME: LIST.BAT (for monochrome)
ECHO OFF
CLS
REM This batch file provides a list of the available batch files and briefly
REM describes each file's purpose.
ECHO
ECHO
ECHO
Batch File Command List
ECHO
ECHO
BKUP
- Fixed Disk File Back Up
ECHO
ECHO
CK
- Spelling Checker
ECHO
ECHO
DB
- DBase III Data Base Program
ECHO
ECHO
ED
- PC-Write Text Processor
ECHO
ECHO
INDX
- Index of Drive Designators
ECHO
ECHO
PM
- Havard Total Project Manager
ECHO
ECHO
PRNT
- Print a Queue of Data Files
ECHO
ECHO
QUIT
- Return to Batch File List
ECHO
ECHO
SS
- 123 Spreadsheet Program
ECHO
ECHO
TLK
- PC-Talk Communications Prog.
The sample batch files below are for color monitor but can be
converted based on the above two files.
NAME: BKUP.BAT
ECHO OFF
CLS
REM This batch file backs up selected files from the fixed disk (C:)
REM to one or more diskettes on drive A:.
C:
CHDIR \DOS
BACKUP C:\AUTOEXEC.BAT A:
BACKUP C:\BATCH\*.* A:/A
BACKUP C:\CONFIG.SYS A:/A
BACKUP C:\DATA\*.* A:/S/A
BACKUP C:\GENERAL\*.* A:/A
BACKUP C:\PROFREAD\PRFDIC.AUX A:/A
IF ERRORLEVEL 1 GOTO ERROR
GOTO FINI
:ERO╥
ECHO
ECHO
ECHO
ECHO
WARNING
ECHO
ECHO This procedure was unable to back up all of the indicated files!
ECHO
PAUSE
:FINI
C:\BATCH\QUIT
Notice how the use of subdirectories can facilitate the back up
of just your data files and not program files.
NAME: ED.BAT
ECHO OFF
CLS
REM This batch file executes the Quicksoft editor program PC-WRITE.
IF %1TEST==TEST GOTO ERROR
C:
CHDIR \PC-WRITE
ED %1
GOTO FINI
:ERROR
ECHO
ECHO
ECHO The command ED must be followed by the name of the file to edit .
ECHO
PAUSE
:FINI
C:\BATCH\QUIT
NAME: INDX.BAT
ECHO OFF
REM This batch file produces a list of the available drive designators and
REM their corresponding physical drive and/or directory.
ECHO
CLS
ECHO
ECHO
ECHO Index Of Available Drive Designators
ECHO
ECHO
A:
- Physical Floppy Disk Drive
ECHO
B:
- Physical Floppy Disk Drive
ECHO
C:
- Physical Fixed Disk Drive
ECHO
D:
- Virtual RAM Disk
ECHO
F:
- FINANCE Directory
ECHO
G:
- GENERAL DATA Directory
ECHO
L:
- LISP Source Code Directory
ECHO
M:
- MASTERS PROGRAM Directory
ECHO
P:
- PASCAL Source Code Directory
ECHO
S:
- SCOUTING Directory
ECHO
Z:
- GAMES Directory
Since you probable will not remember all of the drives which
point to which directory, a list like this, which you can display by
typing INDX at the DOS prompt is handy.
NAME: PM.BAT
ECHO OFF
CLS
REM This batch file executes the program Havard Total Project Manager.
C:
CHDIR \DATA\PROJMANG
PATH C:\PROJMANG
HTPM
PATH C:\BATCH;C:\DOS
C:\BATCH\QUIT
Notice how the path was changed here according to the
recommendations of the software manufacture then changed back to the
original.
NAME: QUIT.BAT
ECHO OFF
C:
CHDIR \BATCH
CLS
LIST
This little batch file is very handy. It can be called at the
end of the other batch files to redisplay the Batch File Command
List or can be typed from the DOS prompt to do the same and refresh
the screen, for example after some DIR's.
After I wrote the reply message about subdirectories, I felt
that I really didn't explain it very well so I created this
document. After throwing together this document, I'm not sure just
how illuminating it is. The best course may be for me to respond to
specific question which you have after your've digesting the above.
I'd be glad to give whatever help I can. (Of course the quick
solution is to by software which does this but, in my biased view,
that's not nearly as much fun.)
Respectfully,
George Noel