Change or view the attributes of one or more files or folders.
Command Prompt →
attrib [+r|-r] [+a|-a] [+s|-s] [+h|-h] [filename] [/s [/d]]
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. The individual attributes are as follows:
- R (read-only)
Turn on the read-only attribute of a file or folder to protect it from accidental deletion or modification. If you attempt to delete a read-only file, Windows will prompt you before allowing you to delete it. Different applications handle read-only files in different ways; usually you will not be allowed to save your changes to the same filename.
- A (archive)
The archive attribute has no effect on how file is used, but it is automatically turned on when a file is modified or created. It is used primarily by a backup software to determine which files have changed since a backup was last performed; most backup programs turn off the archive attribute on each file that is backup.
- S (system)
Files with the system attribute are typically used to boot the computer. There’s little reason ever to modify a file with the system attribute, or to ever turn on or off the system attribute for any file. If you turn off the system attribute of an important file, it may ...