
Managing a DOS File System
114088 Rev. A 5-19
Changing File Attributes
The attr command changes the DOS file attributes. These attributes are displayed
when you enter the
dir command. You cannot delete or rename a file whose
attributes are
s (for system) or h (for hidden). This section describes how to
reassign attributes to such files, so that you can remove these protections.
Hexadecimal values with a 0x prefix determine the set of attributes associated
with DOS files. Determine which hex value is associated with the set of attributes
you want for a file. Then enter the
attr command, along with the hex value and the
name of the file(s) whose attributes you are assigning.
Enter the following to assign one or more attributes to a file in the present working
directory:
attr
<hex_value> <filename.ext>
Enter the following to assign one or more attributes to a file in another directory:
attr
<hex_value>
\
<pathname>
\
<filename.ext>
You can use the wildcard characters * and ? when naming files. Table 5-3 lists the
DOS file attributes, their meanings, and their hex values.
To assign a single attribute to a file, use the hex value associated with the attribute
you want in the attribute command. For example, enter the following command to
assign the read-only file attribute to a file named config located in the present
working directory:
Table 5-3. DOS File Attribute Hex Values
Attribute Flag Meaning Hex Value
a
Archive needed 0x20
d
Subdirectory 0x10 -- not user modifiable
v
Volume ID 0x08 -- not user modifiable
s
System file 0x04
h
Hidden 0x02
r
Read-only file 0x01
Commentaires sur ces manuels