Command Prompt for Windows

Command ATTRIB


Displays or changes file attributes.


ATTRIB [+R|-R] [+A|-A] [+S|-S] [+H|-H] [+I|-I] [+C|-C|+E|-E] [[drive:][path]filename] [/O] [/S]
+Sets an attribute.
-Clears an attribute.
RRead-only file attribute.
AArchive file attribute.
SSystem file attribute.
HHidden file attribute.
IIndexed file attribute.
CCompressed file attribute.
EEncrypted file attribute.
/OTake ownership of files
/SProcess sub-directories.


A file or directory can not be Compressed and Encrypted at the same time.

If a directory is Compressed or Encrypted, then all new files created in the directory will also be Compressed or Encrypted.

Only the NTFS file system supports Compression or Encryption of files and directories.

Sufficient privilege is required to take ownership of a file or file(s).

Also see command DIR.