APPEND
--------------------------------------------------------------------------------
Enables a program to open a data file in a specified directory as if the file were in the current directory. Do not use this command when running Windows.
The specified directory is called the append directory. For opening data files, searches for these files act as if they were appended to the current directory.
Syntax:
APPEND path] ]
To display the list of append directories, use:
APPEND
To delete the existing list of append directories, use:
APPEND ;
Parameters:
path
Specifies the directory and its drive (if different from the current drive) to append to the current directory. Multiple path can be specified, separated by semicolons (;).
;
When used directly, this symbol deletes the existing list of append directories.
Switches:
/X
Indicates whether MS-DOS searches the append directory when the program executes (/X:ON) or not (/X:OFF). /X:ON can be abbreviated as /X. If /X:ON is specified, it must be done when APPEND is first used after the system is booted. After that, /X:ON and /X:OFF can be switched back and forth, with the default being /X:OFF.
/PATH:ON|/PATH:OFF
Indicates whether the program searches the append directory for the data file even if the file name is already in the path the program is looking for. The default setting is /PATH:ON.
/E
Assigns the append directory list to an environment variable named APPEND. This switch can only be used when APPEND is first referenced after the system is booted. With /E, you can use the SET command to display the append directory list. For instructions on environment variables, see the <SET> command.
Note: The Append command cannot be used with Microsoft Windows or the Windows Setup program.
Related Commands
For setting the search path for executable files, see the <PATH> command.
--------------------------------------------------------------------------------
APPEND─Notes
APPEND and Microsoft Windows
APPEND cannot be used with Microsoft Windows or the Windows Setup program.
Running APPEND Multiple Times
You can use APPEND multiple times after the system is booted. But note the following:
★ The /E switch is only effective in the first use of APPEND after the system is booted.
★ The .EXE file extension must be omitted when APPEND is run the second time and later. If you try to enter APPEND.EXE to run APPEND, APPEND will only be loaded once.
Storing the Append Directory List in the Environment
You can use /E in APPEND to assign the list of appended directories to an environment variable named APPEND. The method is to first execute the APPEND command with only the /E switch, and then execute APPEND again, including the directories you want to append. You cannot specify /E and path in the same command line.
Specifying Multiple Append Directories
When appending multiple directories, separate the directory entries with semicolons (;). If you execute APPEND with the path parameter again, the directories specified this time will replace any directories specified in the previous APPEND command.
Append Directories and the DIR Command
The DIR command's execution result list does not include file names from the append directories.
File Name Conflicts
If there is a file with the same name in the append directory and the current directory, the file in the current directory is opened.
APPEND and Programs That Create New Files
When a program opens a file in an append directory, it is as if it were opening a file in the current directory. If the program then saves this file as a new file with the same name, the new file is created in the current directory (not the append directory). APPEND is more suitable for data files that are not modified or are modified but not backed up as new files. Database programs usually modify data files but do not back them up as new files. Text editors and word processors usually store modified data files with backups. To avoid confusion, do not use APPEND with these programs.
/X:ON Switch and PATH Command Usage
Once /X:ON is specified, you can run a program stored in an append directory by simply entering the program name at the command prompt. Normally, the PATH command is used to specify the directory where the program is located. But if your program is in an append directory, you no longer need to use the PATH command to indicate its directory. MS-DOS finds a program in an append directory in the following order: first the current directory, then the append directory, and then the search path PATH.
MS-DOS Functions That Always Use the Append Directory
Even if /X:ON is not specified, when a program calls the following interrupt 21h functions of MS-DOS, the append directory is still used.
★ Open file (0Fh)
★ Open file handle (3Dh)
★ Read file size (23h)
When /X:ON is specified, the program uses the append directory each time it calls the following interrupt 21h functions.
★ Find first entry (11h)
★ Find first file (4Eh)
★ Execute program (EXEC) (4Bh)
Using APPEND on Network Drives
The APPEND command is also applicable to appending directories on network drives.
--------------------------------------------------------------------------------
APPEND─Examples
To enable a program to open data files in the LETTERS directory on drive B and the REPORTS directory on drive A as if they were in the current directory, enter the following command:
append b:\letters;a:\reports
To append the same directories and store the list of appended directories in the MS-DOS environment variable, type the following commands:
append /e
append b:\letters;a:\reports
These commands must be used when APPEND is first executed after the system is booted.