Displays or changes file attributes.
ATTRIB [+R | -R] [+A | -A ] [+S | -S] [+H | -H] [drive:][path][filename]
+ Sets an attribute.
- Clears an attribute.
R Read-only file attribute.
A Archive file attribute.
S System file attribute.
H Hidden file attribute.
Specifies a file or files for attrib to process.
/S Processes matching files in the current folder
and all subfolders.
/D Processes folders as well.
Set the read-only attribute for to file1.txt:
File1.txt attrib +r c:File1.txt, now DOS will not allow
you to delete or modify it (until the attribute is removed).
To set the archive attribute for the file file1.txt
which is in the \DIR1 directory on drive C, enter
attrib +a C:\DIR1\file1.txt