Home > Commands A-M > Commands A

APPEND


Description | Syntax | Parameters | Switches | Related | Notes | Examples | Errorlevels | Availability

Enables programs to open data files in specified directories as if the files were in the current directory.

Do not use this command when Windows is running.

The specified directories are called appended directories because, for the sake of opening data files, they can be found as if they were appended to the current directory.


Syntax

APPEND [drive:][path[;...]] [/X | /X[:ON | :OFF]] [/PATH[:ON | :OFF]] [/E]

To clear the appended directory list:

APPEND ;

To display the list of appended directories:

APPEND


Parameters
drive: (v3.30 Win95 NT3.1)
Specifies the drive (if other than the current drive) you want to append to the current directory. You can specify multiple entries by separating the entries with semicolons.
path[;...] (v3.30 Win95 NT3.1)
Specifies the directory you want to append to the current directory. You can specify multiple entries by separating the entries with semicolons.

Switches
; (v3.30 Win95 NT3.1)
To cancel the existing list of appended directories.
/E (v3.30 Win95 NT3.1)
Assigns the list of appended directories to an environment variable named APPEND. This switch can be used only the first time you use APPEND after starting your system. If you use /E, you can use the SET command to display the list of appended directories. For information about environment variables, see the SET command.
/PATH[:ON | :OFF] (v4.0 Win95 NT3.1)
Specifies whether a program is to search appended directories for a data file when a path is already included with the name of the file the program is looking for. The default setting is /PATH:ON.
/X (v3.30)
/X[:ON | :OFF] (v4.0 Win95 NT3.1)
Specifies whether to search (/X:ON) or not search (/X:OFF) appended directories when executing programs. You can abbreviate /X:ON to /X. If you want to specify X:ON, you must do it the first time you use APPEND after starting your system. After that, you can switch between X:ON and X:OFF. The default value is /X:OFF.

Related

Caution Do not use APPEND with Microsoft Windows or the Windows Setup program.

PATH - To set a search path for executable files.


Notes
Running APPEND with Microsoft Windows

Do not use APPEND with Microsoft Windows or the Windows Setup program.


Running APPEND multiple times

You can use APPEND as many times as you want after starting your system. However:


Storing the list of appended directories in the environment

You can use the /E switch with APPEND to assign the list of appended directories to an environment variable named APPEND. To do this, first use the APPEND command with only the /E switch. Then use APPEND again, this time including the directories you want to append. You cannot specify /E and [drive:]path on the same command-line.


Specifying multiple appended directories

To append more than one directory, separate multiple entries with semicolons. If you use the APPEND command with the [drive:]path parameters again, the specified directory or directories replace any directories specified in a previous APPEND command.


Appended directories and the DIR command

If you specify the DIR command, the resulting list does not include filenames from appended directories.


Filename conflicts

If a file in an appended directory has the same name as a file in the current directory, programs open the file in the current directory.


Using APPEND with programs that create new files

When a program opens a file in an appended directory, the file can be found as if it were in the current directory. If the program then saves the file by creating a new file with the same name, the new file is created in the current directory (not the appended directory). APPEND is appropriately used for data files that are not to be modified or that are to be modified without creating new copies of the files. Database programs often modify data files without making new copies. Text editors and word processors, however, usually save modified data files by making new copies. To avoid confusion, do not use APPEND with these programs.


Using the /X:ON switch and the path command

When /X:ON is specified, you can run a program located in an appended directory by typing the program name at the command prompt. Usually, you use the PATH command to specify directories that contain programs. However, when your program is in an appended directory, you do not need to use the PATH command to specify that directory. A program in found in an appended directory by following the usual order in which is searched for a program; that is, first in the current directory, then in the appended directories, and then in the search path.


Operating system functions that always use appended directories

Even when the /X:ON switch is not specified, appended directories are used when programs call operating system Interrupt 21h functions:

When /X:ON is specified, appended directories are used when programs call any of the Interrupt 21h functions in the preceding list or any of the Interrupt 21h functions:


Using APPEND with network drives

You can use the APPEND command to append directories that are located on network drives.


Examples

To allow programs to open data files in a directory named LETTERS on the disk in drive B and in a directory named REPORTS on the disk in drive A as if the files were in the current directory, type:

    APPEND B:\LETTERS;A:\REPORTS

To append the same directories and keep a copy of the list of appended directories in the environment, type:

    APPEND /E
    APPEND B:\LETTERS;A:\REPORTS

These must be the first APPEND commands you use after starting your system.


Errorlevels

none.


Availability
External Resident
DOS
v3.20 v3.05 v3.1 v3.21 v3.25 v3.30 v3.3A v3.3R v3.3T v3.31 v3.40 v4.0 v4.01 v4.01A v5.0 v5.0A v5.00.02 v5.001A v5.01 v5.02 v6.0 v6.10 v6.2 v6.21 v6.22 v6.23 v7.00 v7.0R1 v7.10
Windows
Win95 Win98
Windows NT
NT3.1 NT3.5 NT3.51 NT4 NT2000

Last Updated: 2006/12/01
Direct corrections or suggestions to: Rick Lively