ATTRIB
Type: External (3.0 and later)
Syntax:
ATTRIB [d:][path]filename [/S]
ATTRIB [+ R|-R] [+A|-A] [+ H|-H] [+ S|-S] [d:][path]filename [/S]
Purpose:
Sets or displays the read-only, archive, system, and hidden attributes of a file or directory.
Discussion
Using the ATTRIB command, you can change a file`s read/write attribute or set the archive attribute. If you use this command to specify a file as read-only, the file can be accessed, but not altered or deleted.
If a file has an attribute of -R, it can be both read from or written to (it is referred to as read/write). If a file has an attribute of +R, it can be read from, but not written to (for example, you can use your word processor to look at it but not to alter it).
NOTE:
If you try to erase a file after you have set its attribute to read-only (+R), DOS will display the words ACCESS DENIED. Before you can erase the file you must use the ATTRIB command to change the file`s attribute to read/write (-R).
The BACKUP, RESTORE, and XCOPY commands can use the archive attribute. You can use the +A or -A options to selectively back up using the BACKUP command. You can also use these options to selectively copy using the XCOPY command.
Wildcard characters (? and *) can be used. However, you CANNOT use a directory name instead of a filename to change the attributes of all files in a directory.
With DOS Version 5 and later you can hide data files by applying the +H (hidden) attribute. -H removes the hidden attribute. The +S (system) and -S options are generally used by programmers to hide and unhide command files used only by DOS. After applying the hidden or system attribute to a file, it will not appear in a directory listing unless you specifically request it with the /A parameter of the DIRECTORY command.
Options
+R - Use the +R option to make a file read-only. Read-only files may be read but they can`t be changed or deleted.
-R - Use the -R option to change the file protection attribute back to normal (so it can be read, changed, or deleted).
+A - Use the +A option to set the ARCHIVE attribute of a file. When the +A option is used, this flags the file as available for archiving when using the BACKUP or XCOPY commands.
-A - Use the -A option to turn off the ARCHIVE attribute.
+H - With DOS Versions 4 through 6, use the +H option to set the HIDDEN attribute of a file so that it will not appear in a directory listing.
-H - Use the -H option to turn off the HIDDEN attribute.
+S - With DOS Versions after Version 4, use the +S option to set the SYSTEM attribute of a file. When the +S option is used, this flags the file as a command file used only by DOS. The file will not appear in a directory listing. This attribute is generally reserved for programmers.
-S - Use the -S option to turn off the SYSTEM attribute.
/S - Use the /S switch to set attributes on subdirectories found within the specified path.
Examples
The following form of the command sets the read-only attribute for the file SALES87.TXT:
SALES87 attrib +r a:sales87.txt
SALES87 After you have set the read-only attribute for the file SALES87.TXT, DOS will not allow you to delete or modify it (until the attribute is removed).
SALES87 To set the archive attribute for the file LETTER3.DOC which is in the \LETTERS directory on drive B, enter
attrib +a b:\letters\letter3.doc
After the archive bit has been set, commands such as XCOPY can selectively act on them (using the BACKUP or XCOPY /M switch). For more information, refer to the BACKUP and XCOPY command sections.
To determine the current attribute settings for all of the files in the current directory, enter
attrib *.*
The attribute settings for all of the files on the current directory will be displayed. If, for example, you were working in the \LETTERS directory on the diskette in drive B, ATTRIB would display something like this:
A B:\LETTERS\LETTER3.TXT
A R B:\LETTERS\SALES87.DOC
B:\LETTERS\SALES-N.TXT
This display indicates that three files were found and that the first two had the archive bit set. The second file is also marked as read-only.
APPEND
Type: External (3.3 and later)
Syntax:
APPEND
APPEND ;
APPEND [d:]path[;][d:]path[...]
APPEND [/X:on|off][/path:on|off][/E]
Purpose: Sets the path to be searched for data files or displays the current search path.
Discussion
The APPEND command is new to DOS with Versions 3.3 and later. It gives you a way to set the search path for data files.
The APPEND command is similar to the PATH command that tells DOS where to search for program files (files with a .COM, .EXE, or .BAT filename extension). The APPEND command guides the search for data files (such as text files).
NOTE:
If a file with a .COM, .EXE, or .BAT filename extension is to be treated as a data file (for example, if you want to edit the contents of a batch file), its path CAN be specified using the APPEND command. However, if you want to execute the file from any directory, you must specify its location using the PATH command.
Use the APPEND command without options to display the current search path.
Using APPEND followed only by a space and a semicolon (APPEND ;) deletes previously appended search paths. DOS will then search for data files only on the current drive and directory.
Use the APPEND command to tell DOS where to search for data files if a specified file is not found in the current directory. This means that you will need only one copy of a file on your fixed disk, even if you use it for different purposes. For example, you can store a copy of the file NAMES1.TXT in the directory LISTS and use it (copy from it, insert it into other files) while working in any drive or directory.
Invalid drive designations will not be detected until DOS attempts to use the search path to find a specified file.
Once APPEND has been loaded into memory, you can re-enter the APPEND command to change the specifications from any drive or directory.
The APPEND command CAN be used on a network.
NOTE:
If you have used APPEND with the /X option and you plan to use the BACKUP and RESTORE commands, you must first cancel the option by entering
append;
If you plan to use the ASSIGN command to redirect drive requests, use the APPEND command first (refer to the ASSIGN command section for more information).
CAUTION:
The APPEND command should not be used with Microsoft Windows or the Windows Setup program.
Options
/X: [on | off] - The /X switch is used by DOS to guide the search path for programs (such as DOS commands)Ê . Set the /X switch before specifying paths to search. The /X switch can only be specified the first time you use the APPEND command. In versions after DOS Version 4 this parameter can be specified as either /X:on (to search appended directories when executing programs) or /X:off (to not searry or the LETTERS subdirectory, enter
append c:\memos;c:\letters
DOS will first search for anOS versions afte specify in the currently active drive and directory. If the files are not found there, it will search the path \MEMOS, and finally the path \LETTERS.
For example, if you want to use the TYPE command to display the contents of the file LET3-9.TXT that is in the \LETTERS directory, you can enter
type let3-9.txt
DOS will first search for the file in current directory, but if it is not found there, DOS will immediately search the \MEMOS and \LETTERS directories on drive B. BR> If you want DOS to search additional directories, you must enter the entire command again, listing all the directories you must be separated by a semicolon. For example, if you want DOS to continue to search the \MEMOS and \LETTERS directories, but R>
append b:;c:\memos;c:\letters
If the files are not found there, it will search the path \MEMOS, and finally the path \LETTERS.
For example, if you want to use the TYPE command to display the contents of the file LET3-9.TXT that is in the \LETTERS directory, you can enter
type let3-9.txt
DOS will first search for the file in current directory, but if it is not found there, DOS will immediately search the \MEMOS and \LETTERS directories on drive B. BR> If you want DOS to search additional directories, you must enter the entire command again, listing all the directories you must be separated by a semicolon. For example, if you want DOS to continue to search the \MEMOS and \LETTERS directories, but R>
append b:;c:\memos;c:\letters