Skip to main content

Path

The PATH command is used to provide access to files located in other directories or on other disks. The PATH command is usually entered as a line in an AUTOEXEC.BAT (or batch) file, which most often contains one or more DOS commands. The AUTOEXEC.BAT file is automatically executed upon system turn-on to run one or more desired programs without the need for user intervention. Other batch  files are executed upon command. When an AUTOEXEC.CAT file is used, each command contained in the file executes as it is encountered.
The creation and use of batch files is described in Section 8.

To illustrate the PATH command, assume you have a program named GATOR.COM that is located in a sub directory. You are not sure if it is cn disk C or disk A, so you want to search both disks and execute the command when found. To complicate matters, you are not sure if the
program is in the SWAMP sub directory or the MUD sub directory. Here is where the PATH command comes to your rescue. To set up a search for GATOR.COM, you can specify the disk and directories using the PATH command. While logged on disk C, assuming that you have a fixed disk system, enter the following command line from the DOS prompt.

                         PATH \SWAMP;\MUD;B: SWAMP;B:\MUD

When you type GATOR to run your program, DOS first searches the C:\SWAMP sub directory, then the C:\MUD sub directory. Next, it
searches the B: SWAMP sub directory. Finally, it searches the B:\MUD sub directory where GATOR.COM is found and executed.

You also can use the PATH command to display the path setup. To do this, type PATH and press Enter. A display similar to the following is displayed.
                                    C> PATH
                                             PATH=\SKAMP; \MUD;B: \SKAMP;2:\MUD

To cancel the path settings, type PATH; and press Enter. The semicolon is the critical agent in this PATH command. Now when you check your paths with the PATH command, the message "No Path" is displayed.

Comments

Popular posts from this blog

DOS Programs (2)

Internal and External Commands Internal and External Commands:  There are  two kinds of DOS commands. These are called internal and external. The internal commands are loaded into memory when DOS is booted. Internal commands are always available for your use, although they are not seen when you display the disk directory of filenames on your screen. Some internal commands are: COPY                               copies files DEL or ERASE               delete files DIR                                  list are directory of filenames on the logged disk PROMPT                         changes the form of the system prompt REN                      ...

Section 4 Introduction

Introduction Section 3 introduced you to the Dir command. You used it to display a list of filenames. This section provides more information about filenames and disk directories, sometimes called file paths. Filenames are given to text, data, and program files that reside on a disk. Directory (or path) names are also given to disk directories, which are convenient subdivisions in which categories or families of files may te collected and maintained. Several commands are available to create, list, or delete filenames and directory names. These include: MKDIR (or MD)            Make (or create a new sub directory. CHDIR (or CD)            Change to (or log) a named directory. RMDIR (or RD)            Remove a named directory. PATH                            Provide automatic access to program and batch files located within one or m...

FORMAT

The FORMAT  command prepares a new disk for use by organizing the disk into magnetic tracks and sectors that are readable by DOS. when a disk is formatted, any files on that disk are usually lost. because of the plethora of disk types and capacities, new parameters were added to the FORMAT command in DOS  version 4.01. MS-DOS 5.00 introduction a safe FORMAT command and the ability to UNFORMAT unintentially formatted disks. These parameters and others are presented in the following paragraph and table. FORMAT Command Form:   There are a number of FORMAT command forms. These are described in the following list. CAUTION  BE aware that the FORMAT command erases all files from the disk being formatted.     Many computer users  have accidentally formatted the wrong disk. If you have programs or    document files  you wish to keep, do not format the disk! (DOS 5.00 lets you UNFORMAT     disk, but even with this ve...