DOS Environment
Microcomputer/DOS Tutorial


Computer Studying

Navigation
{NavForms}

Virus Tutorial Map
Tutorial Map

The environment is a special area in DOS where key information is kept for use by both DOS commands and programs. Normally DOS keeps three pieces of information in the environment space:

  • COMSPEC. The location of the command processor COMMAND.COM (or any other command processor shell DOS may be using.
  • PROMPT. The string that makes up your command prompt if you have changed from the standard C> prompt. For example, many people place the command PROMPT $p$g in their AUTOEXEC.BAT file so that the DOS prompt always shows the current subdirectory as part of the prompt.
  • PATH. This is a string that points to various subdirectories where you might have commands that you wish to execute from anywhere you might be in the disk subdirectory structure.

In addition, many programs ask to put a variable in the environment to point to locations such as where temporary file should be stored. It's possible to fill the environment and run out of space.

PATH

"Follow the yellow brick road" was the instruction to Dorothy in the Wizard of Oz. What can you tell DOS? Follow the PATH.

Let's say you have commands you need to execute often in the following subdirectories: C:\DOS C:\EDIT C:\UTILITY and D:\MYSTUFF.

It is not reasonable to ask you to constantly change to those directories in order to execute the commands; it's also not reasonable to ask you to type the full pathname when trying to execute one of the commands.

Instead, you may place your list of commonly used directories into the environment using the PATH command:

PATH=C:\DOS;C:\EDIT;C:\UTILITY;D:\MYSTUFF

(Use semicolons to separate entries.)

When you do this and then execute a command at the DOS prompt DOS will first look for that command in the default directory. If not found there, DOS will then search each directory in the PATH for the command. The first valid command found on the path will be executed. If the command is not found in the current directory or on the path, then you will receive an error message from DOS.

Organizing Your Hard Disk

Use the information in this chapter to organize your hard disk. Many computer users just fill up their disk in a sort of random manner and then have difficulty trying to find something later. Some rules of thumb should help:

  • 1 - Your root directory should be clean (COMMAND.COM, AUTOEXEC.BAT, CONFIG.SYS, and subdirectories should be about all that's there).
  • 2 - Establish subdirectories for classes of programs (put DOS external commands into \DOS, put batch files into \BATCH, put general utility programs into \UTILITY, etc.).
  • 3 - Don't plan a complicated directory structure many levels deep. It's hard to manage this kind of structure and your PATH statement is limited to the standard DOS command length so a multi-level structure will give you fewer path entries. And,

Back up! - Back up! - Back up! - Back up! - Back up! - Back up!

It can't be said often enough!

Keep Reading Batch Files


{NavBar}
Home | Products | Definitions | Newsletter | Virus Tutorial | Contact


FILExt is proudly hosted by DewaHost.com - a fast and reliable host for everyone!
DewaHost offers premium Web hosting starting from $8.95/month and a high speed file hosting service FileBurst!

Please use the contact form for questions or comments about this web site.
Copyright © 2001 Computer Knowledge, All Rights Reserved
Pray the Rosary for peace.