" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#008000" VLINK="004000" ALINK="#00C000">
ATTR (Attribute) COMMAND
Purpose: Allows to set or display file attributes.
Syntax: ATTR [+S|-S] [+H|-H] [+R|-R] [+A|-A] [/P[ROMPT]] [/M[ORE]] FILELIST
Type: Internal command
Parameters:
+S - sets the system attribute of a file.
-S - cancels the system attribute.
+H - sets the hidden attribute of a file.
-H - cancels the hidden attribute.
+R - sets the read-only attribute of a file.
-R - cancels the read-only attribute.
+A - sets the archive bit of the file.
-A - cancels the archive bit of the file.
If you enter consequently several ATTR commands with different
attributes the result will be the sum of commands. For example, you enter
ATTR +h a.bat
and then, after a time you enter
ATTR +r +s a.bat
A.BAT file will have attributes "hidden", "system" and "read only".
/P[ROMPT] - prompts the user for confirmation to change the attribute of
the file
/M[ORE] - pauses after each screenful of information.
FFILELIST ::= [parms]
{
[d:][path]file_name[.ext] |
(FILELIST[,|+| ]...) |
@reference_file
}
FILELIST - defines the files for setting attributes to.
(See INTERNAL DOS COMMAND ARGUMENTS for detailed description)
file_name - may contain wild card symbols ( '?' and '*' ).
reference file - is the name of a text file containing
the command's options. It should be specified
explicitly.
parms - are any combination of the following keys:
/S - to include subdirectories in the search
/O[:order] - sets the directory element sorting criteria.
order is a set of the sorting criteria control symbols:
G - sort on the attributes
N - sort on the file names
E - sort on the file extensions
S - sort on the file size
D - sort on the date of creation
Minus sign before a control symbol changes the sorting
criteria to a complementary one. If no order parameter is
present, the following sorting criteria is used: on
attributes, then on names and extensions.
Examples:
1. A:\>attr +r -a file1.txt
This command sets the "read-only" attribute to the FILE1.TXT file and
cancels the "archive" bit. The following message will be displayed on the
screen:
FILE1.TXT attributes are set to -R---
(the "read-only" attribute is set for the FILE1.TXT file)
2. A:\>attr file1.txt
This command displays attributes of a file. The screen will display:
-R--- FILE1.TXT
3. A:\>attr -r file1.txt
This command cancels the "read only" attribute.
4. A:\>attr file1.txt,
On entering this command you may see that the "read only" attribute has
been cancelled:
----- FILE1.TXT
5. A:\>attr +a /P file?.txt
If the user specifies the /P key ("with prompt") then the shell will
ask for confirmation before changing the attributes:
FILE1.TXT change attributes for this file {Y/N/All yes/Quit}? _
To reply, the user should input one of the above answers and press
[Enter]. Pressing [Enter] alone is equal to "Y".
"Y" - the current file attributes are set and the Shell jumps to the next
file.
"N" - the current file attributes are left without changes and the Shell
immediately jumps to the next file.
"A" - attributes of all the remaining files are modified with no asking
for user confirmation.
"Q" - quit the command.
Note:
Modifying the archive bit affects the BACKUP/M command. If the bit is
set, the corresponding file is copied; if the bit is cancelled (equal to
zero), then no file copying occurs.