Sets attributes of a file or directory.
setfileattr <filename> <attributes>
| Value | Meaning |
|---|---|
| $1 | Read only |
| $2 | Hidden |
| $4 | The operating system uses a part of, or uses exclusively |
| $20 | Archive |
| $80 | Not have other attributes set Enabled when the value is independently specified. |
| $100 | Temporary |
| $1000 | Physically moved to offline storage(Windows 2000 or later) |
| $2000 | Not to be indexed by the content indexing service(Windows 2000 or later) |
; add readonly attribute file = 'c:\test.txt' getfileattr file attr = result | $1 ; keep current attributes setfileattr file attr