Search notes:

attrib.exe

attrib.exe displays or changes file or directory attributes.

Command line options

/S Processes matching files in the current folder and all subfolders.
/D Processes folders as well.
/L Work on the attributes of the Symbolic Link versus the target of the Symbolic Link

Letters used when changing attributes

When attrib.exe is invoked to change an attribute, the attribute being modfified is denoted according to the following table.
To set an attribute, the letter needs to be prended by a plus symbol, to remove it, by a minus symbol.
R Read-only file attribute.
A Archive file attribute.
S System file attribute.
H Hidden file attribute.
O Offline attribute.
I Not content indexed file attribute.
X No scrub file attribute.
V Integrity attribute.
P Pinned attribute.
U Unpinned attribute.
B SMR Blob attribute.

Examples

The following command hides the file xyz.txt:
C:\users\rene> attrib +h xyz.txt
The following command makes it visible again:
C:\users\rene> attrib -h xyz.txt

Show attributes of files and directories

attrib * shows all files in the current directory along with their attributes.
In order to also see the attributes of directories, the /d option can be used:
C:\Users\rene> attrib /d
The cmd.exe dir command has the /a option that allows to include or exclude files with specific attributes in its output.

See also

A file that needs to have the system attribute set to have any effect is desktop.ini

Index