Utility Descriptions 5-3
ATTRIB
The ATTRIB command either displays or modifies the attributes of a file
or directory.
Syntax
ATTRIB [+R | -R] [+A | -A] [+S | -S] [+H | -H] [[drive:][path]filename] [/S]
[/C]
Remarks
The file attributes define the characteristics of a file. They determine if a
file may be deleted or modified, or if it is archived. Use the ATTRIB
command to manage these file attributes.
Wildcard characters may be used in the ATTRIB
filename.
The ATTRIB command modifies file attributes if modify commands are
given to ATTRIB. The modify commands are
Option Description
+/- Add(+) or remove(-) attribute inserted
before each option.
A Archive attribute
-C Clear all attributes
H Hidden file attribute
R Read Only attribute
S System file attribute
/S Recurse into subdirectories
If ATTRIB finds no modify commands, then it displays the files in the
specified directory along with the filenames and their current attributes.
Examples
ATTRIB +r myfile.dat
Adds the Read Only attribute to the file myfile.dat.