Command: attrib

  ATTRIB displays or changes file attributes.


  ATTRIB { options | [drive][path]filename | /@[list] }
         drive     The drive letter, e.g. C:
         path      The directory, e.g. \example\
         filename  The file, e.g. test.exe


  +A  Sets the Archive attribute.
  -A  Clears the Archive attribute.
  +H  Sets the Hidden attribute.
  -H  Clears the Hidden attribute.
  +R  Sets the Read-only attribute.
  -R  Clears the Read-only attribute.
  +S  Sets the System attribute.
  -S  Clears the System attribute.
  /@  Process files, listed in the specified file [or in stdin].
  /D  Process directory names for arguments with wildcards.
  /S  Process files in all directories in the specified path(es).
  /?  Shows the help.


 If no file is specified, then the attributes for all files in the
  current directory are changed (or simply displayed if none of
  the above specifiers are used.)
  The archive attribute (+A) is set when a file is modified. Backup
  utilities can clear the attribute to indicate that the file
  has been backed up.
  If a file has the hidden (+H) flag, it is not shown if you type "dir".
  If a file has the read only (+R) flag, it can be read but not changed.
  If a file has the system (+S) flag, it is specially protected, e.g.
  it cannot be deleted or overwritten.
  ATTRIB has the following EXITCODES (ERRORLEVEL):
    0  completion successful; /? option used.
    1  error to change attribute(s) of file(s).
    2  no matching file(s) found for target(s).
    3  error open file(s), pointed in /@ option(s).
    4  error(s) in command line.


  attrib file -rhs               (removes attributes read/hidden/system)
  attrib file -r -h -s           (removes attributes read/hidden/system)
  attrib +a -r dir1 dir2*.dat /s
  attrib -hs/sd /@list.txt *.*   (-hidden/system / file/directory names)

See also:


  Copyright © 2004 Robert Platt, updated 2022 by W. Spiegl.

  This file is derived from the FreeDOS Spec Command HOWTO.
  See the file H2Cpying for copying conditions.