attrib |
Displays, modifies, or removes file attributes such as Read-only, Archive, System, and Hidden.
attrib [+r -r] [+a -a] [+s -s] [+h -h] [ [ drive :] [ path ] filename ] [/s [/d] ]
Sets Read-only attribute (useful for protecting users from themselves ).
Clears Read-only attribute.
Sets Archive attribute (indicates files that have changed since the last backup was performed).
Clears Archive attribute.
Sets System attribute. (System files are generally protected operating-system files.)
Clears System attribute.
Sets Hidden attribute. (By default, hidden files aren't displayed in Windows Explorer.)
Clears Hidden attribute.
Sets or clears attributes recursively, starting from the current directory and extending to all subdirectories.
Sets or clears attributes on directories only.
Indicates location and name of the directory, file, or set of files whose attributes you want to set or clear. (The wildcards ? and * can also be used.)
Display the attributes of all directories and files in the current directory:
attrib A C:\AUTOEXEC.BAT A SH C:\boot.ini A C:\CONFIG.SYS A SHR C:\IO.SYS A SHR C:\MSDOS.SYS A SHR C:\NTDETECT.COM A SHR C:\ntldr A SH C:\pagefile.sys
List the attributes of C:\boot.ini (used to create the Boot Loader menu):
attrib C:\boot.ini A SH C:\boot.ini
Note that the Archive (A), System (S), and Hidden (H) attributes are set on this file.
Remove the System and Hidden attributes of boot.ini so the file can be modified (leave the Archive attribute unchanged):
attrib C:\boot.ini -s -h
View the attributes again:
attrib C:\boot.ini A C:\boot.ini
The file with the System or Hidden attribute set must have these attributes cleared before you can change any other attributes for that file.
To display or view advanced attributes such as encryption and compression state, see cipher in this chapter.
attrib is also available from the Recovery Console.
cipher , Files and Folders , Recovery Console