Anyone know of a good resource for all of the values and definition in the windows explorers file attribute column?
R = Read-Only: Most software, when seeing a file marked read-only, will refuse to delete or modify it. This is pretty straight-forward. For example, DOS will say "Access denied" if you try to delete a read-only file. On the other hand, Windows Explorer will happily munch it. Some will choose the middle ground: they will let you modify or delete the file, but only after asking for confirmation.
H = Hidden: This one is pretty self-explanatory as well; if the file is marked hidden then under normal circumstances it is hidden from view. DOS will not display the file when you type "DIR" unless a special flag is used, as shown in the earlier example.
S = System: This flag is used to tag important files that are used by the system and should not be altered or removed from the disk. In essence, this is like a "more serious" read-only flag and is for the most part treated in this manner. It is also a "super-hidden" attribute. Even if you enable “Show hidden files”, system files will not be displayed. (You can display them by disabling “Hide protected operating system files.”)
D = Directory: This is the bit that differentiates between entries that describe files and those that describe subdirectories within the current directory. In theory you can convert a file to a directory by changing this bit. Of course in practice, trying to do this would result in a mess--the entry for a directory has to be in a specific format.
A = Archive: This is a special bit that is used as a "communications link" between software applications that modify files, and those that are used for backup. Most backup software allows the user to do an incremental backup, which only selects for backup any files that have changed since the last backup. This bit is used for this purpose. When the backup software backs up ("archives") the file, it clears the archive bit (makes it zero). Any software that modifies the file subsequently, is supposed to set the archive bit. Then, the next time that the backup software is run, it knows by looking at the archive bits which files have been modified, and therefore which need to be backed up. Again, this use of the bit is "voluntary"; the backup software relies on other software to use the archive bit properly; some programs could modify the file without setting the archive attribute, but fortunately most software is "well-behaved" and uses the bit properly. Still, you should not rely on this mechanism absolutely to ensure that your critical files are backed up.
Missing from the above list:
C = Compressed: compressed files/folder cannot be encrypted.
E = Encrypted: encrypted files/folders cannot be compressed.
N = NOT INDEXED
L = Reparse Points
O = OFFLINE
P = Sparse File
I = Not content indexed
T = TEMPORARY
Combinations are possible, e.g., HSA = Hidden, System, Archive
I haven't found this on the internet yet, but there is also a "P" attribute, corresponding to a sparse file. This flag is listed in Windows 7, but not in Windows XP. Not sure about Vista.
You can turn a file sparse with the
Sparse files are similar to compressed files, but a bit more specific. With sparse files, long ranges of null (value 0) bytes are simply not stored on disk. When a program tries to access that part of the file, the file system will see that it is not on the disk and return a range of null bytes instead. See this MSDN page for more info on sparse files.
The "I" flag stands for "Indexed". Indexing Service or Windows Search won't include those files in their indexing operation when set.
Attributes shown in Windows Explorer:
Attributes shown in 'attrib' command output:
Attributes shown in "%~a1" (
The authoritative reference of NTFS file attributes: https://msdn.microsoft.com/en-us/library/windows/desktop/gg258117(v=vs.85).aspx