Command Prompt for Windows




Command ATTRIB

Function:

Displays or changes file attributes.

Syntax:

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.

Note:

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.