ATTR (Attribute) Charles Petzold Command PC Magazine Vol 5, No 11 Copyright 1986 Ziff-Davis Publishing Company ______________________________________________________ Purpose: ATTR.COM permits display and modification of the archive, system, hidden, and read-only file attributes. Format: ATTR or ATTR *.* or ATTR [+A|-A] [+S|-S] [+H|-H] [+R|-R] [d:][path]filename[.ext] Remarks: Entering ATTR without any parameters, as in the first format shown above, produces a help display (essentially identical to the third form above) that shows which file attributes can be changed. ATTR.COM permits the use of the global ? and * characters (as in the second format above). Entering ATTR filename displays a specific file's attributes. For example, ATTR IBMBIO.COM returns the display IBMBIO.COM Arc Sys Hid R-O showing that the Archive, System, Hidden, and Read-Only bits of the attribute byte are set for this file. When wildcards are used to list the attributes of all the files in a directory, subdirectory names are shown as Dir (between the Arc and Sys in the example above). Unlike the DOS DIR command, ATTR lists hidden files, whether sought by specified filename or through a *.* listing. However, ATTR does not show Volume names or the dot and double- dot entries in subdirectories. The syntax for changing file attributes is indicated in the third format above. After typing ATTR (and a space) you simply precede the file specification with a plus or minus sign, followed by the letter A (Archive), S (System), H (Hidden), or R (Read-Only). A plus sign turns on the specified attribute; a minus sign turns it off. More than one attribute can be changed at once, and the attribute-designating letters may be entered in any order and in upper- or lowercase. No space may be used between the plus or minus and the letter that follows it, however. Example: To convert the file 85TAX.WKS to hidden and read-only, you would enter ATTR +H +R 85TAX.WKS Since DOS itself normally sets the Archive bit, entering ATTR 85TAX.WKS would produce the display 85TAX.WKS Arc Hid R-O Since the Hidden attribute has been set, however, the DIR command will produce the message, "File not found." And since the Read-Only flag has also been set, a DEL command will produce the message, "Access denied." Notes: 1. Requires DOS 2.0 or later.