|ATTRIB [+R | -R] [+A | -A ] [+S | -S] [+H | -H] [[drive:] [path]
filename] [/S [/D]]
+ :Sets an attribute.
- :Clears an attribute.
R :Read-only file attribute.
A :Archive file attribute.
S :System file attribute.
H :Hidden file attribute.
/S :Processes files in all directories in the specified
/D :Process folders as well.
Multiple attributes can be set/cleared by combining switches
(separated by spaces).
Typing attrib by itself will display all files in the current
directory and each of their attributes. If any file is hidden it
will also display those files.
To display the attributes of a directory
To display the attributes of a file
attrib +r customer.xls
Add the read-only attribute to the customer.xls file so it cannot be
modified until the read only attribute is taken off. This is helpful
for important system files or any other file that you do not want to
have mistakenly edited or changed.
If this file was located on C:\business\customer.xls and you want to
make it read-only then you would use the following attrib +r