CONFIGURING THE MSDOS ENVIRONMENT
MSDOS has the advantage of allowing the user to create an environment tailored specially
for the particular task they wish to accomplish, or customise MSDOS to suit the current
hardware.
The environment will include the files and programs, as well as specifying where they
exist. It will also specify additional information which programs such as compilers and
linkers need in order to run.
DATE and TIME
The commands date and time are used to enter the current date and time into
the computer. This is used to date stamp files when they are created. Typing the command
generates a prompt for you to enter the current value. If it is correct, or you do not
wish to change it, just press the return key.
If the date is in the wrong format, ie, mm-dd-yy instead of dd-mm-yy, this can be altered by inserting a country code value of 61 into the config.sys file.
device=country.sys 061
MSDOS PROMPT STRING
The default MSDOS prompt displayed is the drive specifier followed by the greater than
symbol,
A>
This prompt is changed by using the PROMPT command, followed by the various
arguments representing the prompt desired. The options are,
Comand | Effect | Command | Effect |
$t | current time | $g | > |
$l | < | $b | | |
$q | = | $h | backspace character |
$e | escape character | $d | current date |
$n | current drive | $p | current directory |
$$ | $ |
Example 1 | Example 2 |
PROMPT $t$g | PROMPT Hello$g |
11:05:38....> | Hello> |
PATH
This specifies which drives and directories MSDOS will search in order to locate the
requested .com, .exe, or .bat file.
PATH A:\;b:\
will inform DOS to search the root directories of drive a and drive b. Note that if
more than one drive or directory is specified, you must use a semi-colon to separate them.
If the path command is entered without any arguments, it will display the current setting.
The default is the boot drive, A:\
SET
This command is used to set MSDOS shell variables. MSDOS keeps a table, called the environment
table, which holds shell variables. An application program can use the environment
table to search for specific variables. Some packages, such as the Microsoft Link program,
use the set command to enable the Link program to find where various library
routines are located.
Because the path command cannot be used to locate programs ending in .lib, the Link program uses the set enviroment to locate them, eg,
A> SET lib=a:\
When the Link program examines the enviroment, it will discover that the library is located in the root directory of drive a.
Typing set without arguments will display all the current environment settings.
Windows uses the environment variable TEMP to point to the subdirectory where temporary files are created.
In setting up a workstation environment, you might consider using the SET command to
set MSDOS variables which hold the screen type, directories, login names, printer types
etc. These variables can be used by BATCH programs to correctly run applications or set
the correct path for applications to run correctly.
ASSIGN
This command is used to redirect drive requests. Requests for any drive may be redirected
to another specified drive by the use of the assign command.
ASSIGN B=C
In this example, whenever MSDOS requests drive B, it will actually access drive C
instead.
SUBST
The substitute command substitutes a drive or path with an MSDOS drive letter. The
following command substitutes drive D: with the subdirectory C:\BIN
SUBST D: C:\BIN
When accessing drive D:, the user is actually referencing C:\BIN. To MSDOS applications, C:\BIN appears as the root directory of drive D, thus it is not possible to reference any directory above C:\BIN using drive D:
Typing SUBST without any parameters will display the current drive
substitutions. To delete a substituted drive, use the drive letter as the only argument.
Command | Effect |
subst d: c:\bin | lets d:\ refer to c:\bin |
subst | displays current drive substitutions |
subst d: | delete drive substitution for d:\ |
COMSPEC
This shell variable holds the full pathname for finding command.com. In order for MSDOS to
give as much memory as possible to applications, command.com is sometimes overwritten.
When the application terminates, the shell must be reloaded. If there is no comspec
variable, then MSDOS tries to find command.com in the root directory of the current drive.
Specifying the pathname of command.com using the comspec variable allows MSDOS to reload it when required.
comspec=c:\dos\command.com Setting the comspec variable is done by adding the statement to the autoexec.bat startup file.