In Windows, what are file attributes, and how can I change them?
File attributes can be used to write-protect, hide, and unhide files, or in behind-the-scenes file maintenance:
- Read-only: Readable, but cannot be changed or deleted
- Hidden: By default, not displayed in a directory listing
- Archive: Used for selectively backing up or copying files; most helpful in DOS
- System: Flagged for use by the operating system; not usually displayed in a directory listing
Changing file attributes
View or change file attributes
To view or change the attributes of a file, right-click the file, and
then click Properties. In the "Attributes:" section, enabled
attributes have checks beside them. Add or remove the checks from
Read-only, Archive, or Hidden to enable or
disable these options. If you want to change the System
attribute, you need to do it from the command prompt.
Note: In Windows 7, Vista, or
XP, you will see only the Read-only and
Hidden checkboxes on the first screen. To see the
Archive checkbox, click Advanced.
Change file attributes from the command prompt
To determine what attributes are enabled on a file, you must use the
attrib command in the command prompt. In the
directory where the file is located, enter:
attrib filename.ext
Replace filename.ext with the full name of the file.
You should see something like:
A SHR FILENAME.EXT C:\FILENAME.EXTThe initials on the left stand for the first letter of the enabled attribute: A for Archive, S for System, H for Hidden, and R for Read-only.
To clear an attribute with attrib, use
- (the minus sign), for example:
attrib -s -h -r filename.ext
Using the minus signs after attrib in the above example
clears the System, Hidden, and Read-only attributes from the file. To
add an attribute, use + (the plus sign), as
follows:
attrib +h filename.ext
Using the plus sign in this example adds the Hidden attribute to the file.
Last modified on October 11, 2011.







