Most file commands in TCC include the /A: switch, which allows you to select files for the command to process based on their attributes. These switches all use the format /A[:][-+]RHSAD. The colon after /A is optional in DIR, FFIND, and SELECT, but is required in all other commands. The characters after the /A: specify which attributes to select, as follows:




On NTFS volumes, the extended attributes below are also available.


FSparse file
INot content-indexed
LSymbolic link or Junction (reparse point)
NNormal (cannot be used for file selection)
PPinned (Windows 10+ or OneDrive)
UUnpinned (Windows 10+ or OneDrive)
VIntegrity (Windows Server 2012R2+ ReFS only)
XNo scrub data (Windows Server 2012R2+ ReFS only)


The N (normal) attribute is not stored on disk. It is dynamically generated by the operating system if none of the other attributes is set. Its use for file selection is not supported in either commands or variable functions.


If no attributes are listed at all (i.e., /A:), the command will process all files, and (where applicable) all subdirectories, including hidden and system files and directories.


If attributes are combined, all the specified attributes must match for a file to be selected. For example, /A:RHS will select only those files with all three attributes set.


If you precede an attribute with a hyphen -, files with that attribute will be excluded. For example, /A:RH-S selects files which have the read-only and hidden attributes set and which do not have the system attribute set.


If you precede an attribute with a plus +, files will be selected which have that attribute turned on or off. When multiple attributes are preceded by +, only files which have at least one of these attributes will be selected. For example, /A:+H+S will select files with the hidden or system attribute, or both, but will not select files which have neither attribute set. /A:R+H+S will select files which are read-only, and also have the hidden or system attribute, or both.


You can combine the plus sign, hyphen, and unmarked attributes to build a specification as complex as you need.


If you use the format /A:=, TCC will display a dialog that allows you to select the attributes you want:






The (dangerous!) command below will make all hidden, system, and/or read-only files in the default directory visible and writeable, but not modify the attributes of files which are neither hidden nor system nor read-only (thus not reporting files already in the desired state):


attrib /e /p /a:+r+h+s -r -h -s