Download PDF version [opens new window]
We use digital files every day, but it’s relatively rare we need to recognize the attributes of a digital file. This article is all about understanding File Attributes in Windows.
You might for example have wondered how the Windows operating system differentiates files that are visible from those that are hidden. Or let’s say a text editor program pops up an error message informing you the file is “read-only” when you’re trying to save changes to the file - you might ask yourself: how does the text editor know that the file is read-only? File Attributes tag files with additional information that Windows uses to act on.
Knowing a little about File Attributes will help you understand why certain things happen with files, and why certain things can’t happen if an attribute is defined in a certain way.
File attributes are pieces of information associated with every file and directory that includes additional data about the file itself or its contents. They can exist in only one of two states – Set or Cleared; like an On or Off state. Attributes can be in files, directories, volumes and certain system objects. They are used by the operating system and software applications to define file system behavior.
A byte stores the attributes of a file, with each specific attribute assigned to a bit of a byte. To enable a certain attribute, the system will assign a ‘one’ to the corresponding bit, which represents the ‘On’ state. (These are referred to as flagging or setting the attribute). A Windows operating system (Win32) stores the file attributes as 32-bit quantity, while the original MS-DOS file attributes only have 8 bits to store file attributes.
Below are the common attributes and the bits that represent them:
Not Content Indexed (I)
A file may have more than one attribute mapped to it by adding the bits to form the byte attribute. A read-only, hidden directory would have the attribute byte of 00010011, a result of the three attributes added together. Below are the descriptions of each attribute:
Note that certain programs may modify the files without marking the archive attribute. If the backup software uses incremental backups to backup these files, it will rely on the software to set the bit appropriately. It is therefore important to note that you should not rely solely on this setting to ensure critical files are backed up.Not Content Indexed (I) : Windows has a search function which indexes all the files and directories in the drive in order to achieve faster results. By default, this attribute is not set, thereby allowing the operating system to include the file into the indexing list. A user could choose to opt out certain files by setting this attribute to On. When set, Windows will skip files that have this option checked.
There are a few ways to view and change attributes. Two of them are via the file or folder properties from Windows Explorer or using the ATTRIB command from MS-DOS prompt (type CMD command to bring up the DOS window).
Right-clicking and selecting Properties on any file or folder in Windows Explorer will bring up the Properties window, which shows the attributes of the selected item.
Note: The extended attributes (compress and encrypt) will not be shown when you use the ATTRIB command. However, you can view these attributes by executing the Compact and Cipher commands, respectively.
To view attributes, you can type ATTRIB command from the DOS prompt.
Typing ATTRIB /? will bring up a list of all the syntax available to query a file.
To view what attributes are assigned to a file, type the following:
From here, we can see that the TEST.TXT file has the Archive, Hidden and Read-Only attribute enabled (A, H & R are shown).
Using the ATTRIB command allows a user to Set or Clear an attribute of a file. For the above example, if we wish to remove the attribute of Hide and Read-Only from the file, we could type:
ATTRIB -H -R C:\FOLDER\TEST.TXT
The example above shows that the hidden and Read-Only attribute have been removed from TEST.TXT.
This article has hopefully helped you understand a little more about Windows file attributes. Being familiar with file attributes will help you better understand how the file system works in a Windows environment. You could use this knowledge to your advantage by selecting the Fast Backup (scanning the Archive Attribute) option in SyncBackSE and SyncBackPro to greatly reduce the time needed for each backup, thereby increasing your productivity and freeing up your system resources for other tasks.