append(CMD) 19 June 1992 append(CMD) Name append - open files in specified directories as if the files were in the current directory Syntax append [[drive:]path[;...]] [/x[:on|:off]] [/path:on|/path:off] [/e] To display the list of appended directories, use the following syntax: append To cancel the existing list of appended directories, use the following syntax: append ; Description 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. Parameters [drive:]path Specifies the drive (if other than the current drive) and directory that you want to append to the current directory. You can specify multiple entries of [drive:]path, separating the entries with semi- colons. ; When used by itself, (append ;) cancels the existing list of appended directories. Switches /x[:on|:off] Specifies whether MS-DOS is to search appended directories when exe- cuting programs. If you use the /x:on switch, the program does search appended directories. If you use the /x:off switch, the program does not search appended directories. 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. /path:on|/path:off 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. /e 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 infor- mation about environment variables, see the set(CMD) command. Notes 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 semi- colons. 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 The dir command does not add filenames from appended directories to directory listings produced by the dir command. 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 cre- ated 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 pro- grams 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, you might want to avoid using 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. How- ever, when your program is in an appended directory, you do not need to use the path command to specify that directory. MS-DOS finds a program in an appended directory by following the usual order in which MS-DOS searches for a program; that is, first in the current directory, then in the appended directories, and then in the search path. MS-DOS functions that always use appended directories Even when the /x:on switch is not specified, appended directories are used when programs call the following MS-DOS Interrupt 21h functions: + Open File (0Fh) + Open File Handle (3Dh) + Get File Size (23h) 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 in the following list: + Find First Entry (11h) + Find First File (4Eh) + Execute Program (EXEC) (4Bh) Using append with the assign command If you use both the append and assign commands, you must use append first, even if the commands affect different drives. When you use the assign command to assign a different drive letter to an existing disk drive, you cannot use the append command to append directories that use the new drive letter. 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 the following com- mand: append b:\letters;a:\reports To append the same directories and keep a copy of the list of appended directories in the MS-DOS environment, type the following commands: append /e append b:\letters;a:\reports These must be the first append commands you use after starting your sys- tem. Related command For information about setting a search path for executable files, see the path(CMD) command.