Tandy 1000 MS-DOS Reference Manual page 129

Hide thumbs Also See for 1000 MS-DOS:
Table of Contents

Advertisement

r
I'
l
r
1
I '
l '
I:
I '
!
I '
i
Chapter 6 / Command Reference
Suppose you have three programs (Myprog, Samprog, and Sal:
prog). Each requires you to be in a separate directory. To create
a batch file to put you in the proper directory, type:
copy con progdir.bat
I
ENTER
I
rem ThlS file changes the dir for myprog,
samprog, or salprog
I
ENTER
I
rem When executlng, substitute the drive for
:-:1, the program name for :-:2
I
ENTER
I
:-: 1
I
ENTER'
if :-:2==myprog goto w
I
ENTER
I
if :-:2==samprog goto x
[ENTER'
i f :-:
2 = =sal pro 9 got
0
y
I
ENTER'
goto end
: w
I
ENTER'
chd
1
r \user \myprog
I
ENTER
I
got
0
:
z
I
ENTER'
: x
I
ENTER
I
chdir \user\samprog
I
ENTER
I
got
0
:
z
I
ENTER
I
: y [
ENTER
I
c h d i r \ use r \ sal pro 9 [
ENTER
I
: z
I
ENTER
I
c
h d i
r
I
ENTER
I
: end
I
ENTER
I
[ill [
ENTER'
Execute the batch file by entering its filename, followed by the
drive and program name. For example, to change to the correct
directory for Myprog, type:
progdir B: myprog
I
ENTER
I
The batch file substitutes B: for %1, making Drive B your cur-
rent drive. Then it substitutes Myprog for %2. It goes to label
:W and changes the directory to \ USER\MYPROG. Then it
goes to :Z. The line following :Z causes CHDIR to display the
current directory to verify that it is correct.
115

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents