Attrib — windowssystem32attrib.exe
Attrib allows you to change the file and folder attributes from the command line, settings otherwise only available in a file's or folder's Properties window. The attributes can be thought of as switches, independently turned on or off for any file or group of files. Attrib is used as follows:
attrib [+r|-r] [+a|-a] [+s|-s] [+h|-h] [filename
]
Option |
Description |
---|---|
r |
(read-only) Turn on the read-only attribute of a file or folder to protect it from accidental deletion or modification. |
a |
(archive) The archive attribute has no effect on how a file is used, but is automatically turned on when a file is modified or created. |
s |
(system) Files with the system attribute are typically used to to boot the computer. |
h |
(hidden) To hide any file or folder from plain view in Explorer or on the Desktop, turn on its hidden attribute. |
For example, to hide a file, type attrib +h
filename
. To turn off the hidden
attribute and simultaneously turn on the archive attribute, type
attrib -h +a
filename
.