The Big Picture: Little Switches on Every File

Every file and folder carries a few on/off switches called attributes. They are stored in the file's $STANDARD_INFORMATION (Section 4.1). Each switch is a single bit. Some are hints to programs ("do not show this in the folder view"); others change how the file system stores the data ("squeeze this", "scramble this").

Attributes are not permissions. Permissions (Section 5) decide who may act. Attributes describe the file itself.

7.1 Read-only, Hidden, System, Archive

What it is: These four classic attributes go back to MS-DOS.

AttributeShort codeWhat it means
Read-onlyRPrograms should not change or delete this file without clearing the switch first
HiddenHExplorer does not list it unless "Show hidden files" is on
SystemSMarks an important operating-system file. Explorer hides these even more strongly
ArchiveA"Changed since the last backup." Windows sets it whenever a file changes; some old backup tools clear it

Important honesty about these switches:

  • Hidden is not security. It only hides the file from the normal view. Anyone can show hidden files, and dir /a lists them.
  • Read-only is a polite request. It stops accidental changes in many programs, but you can clear it in two clicks. For real protection, use permissions (Section 5).
  • The System flag is a warning sign: "this belongs to Windows".

On a folder, the Read-only box in Properties is mostly a marker used by Explorer (for special folders). It does not make the files inside read-only.

Change them in File Explorer: right-click the file → Properties → General tab → tick Read-only or Hidden. To see hidden files, use View → Show → Hidden items.

Change them on the command line with attrib:

attrib                      lists the attributes of files in this folder
attrib +r notes.txt         set Read-only
attrib -r notes.txt         clear Read-only
attrib +h notes.txt         set Hidden
attrib -h notes.txt         clear Hidden
dir /a:h                    list only hidden files

The letters in the output show what is on. For example:

A   H        C:\Users\Sam\Documents\FSLab\notes.txt

means the Archive and Hidden switches are on.

PowerShell: Get-ChildItem -Force shows hidden files too (-Force means "include things you would normally not see"). (Get-Item notes.txt).Attributes prints the switches as words.

7.2 Compression and Encryption Attributes (EFS)

What it is: Two more attributes ask NTFS to change how the data is stored. They only exist on NTFS.

Compression (C). NTFS can compress a file: it squeezes the data into fewer clusters, and unsqueezes it automatically whenever a program reads it. Programs never notice.

PointDetail
How to switch onRight-click → Properties → Advanced → Compress contents to save disk space
How you can tellExplorer can show compressed names in blue (a setting you may have to enable)
CostA little extra CPU time when reading and writing
Best forText, documents, logs. Photos, videos and ZIPs are already compressed and gain nothing

Encryption (E) with EFS. EFS stands for Encrypting File System. Encryption means scrambling the data with a secret key so that it is unreadable without that key. EFS is built into NTFS and ties the key to your Windows account.

PointDetail
How to switch onProperties → Advanced → Encrypt contents to secure data
What you seeThe file works normally for you. Explorer can show encrypted names in green
Other usersAnother account on the PC (even an administrator) cannot read the data without your key
Big warningIf you lose the encryption key (for example you reinstall Windows without a backup of the certificate), the data is gone for good
AvailabilityNot available in Windows Home editions. It is in Pro, Enterprise and Education

EFS is not BitLocker. They solve different problems:

EFSBitLocker
ProtectsIndividual files and foldersThe whole volume (everything on the drive)
Tied toYour Windows accountThe drive, unlocked at start-up (for example by the PC's security chip, called the TPM, or a recovery key)
Guards againstOther users on the same PCA stolen laptop or drive

Windows Home often offers a simpler "Device encryption" instead; check Settings → Privacy & security.

Compression and encryption cannot be combined on the same file. If you turn on one, the other turns off.

Other attributes you may meet:

AttributeMeaning
Not content indexed (I)Windows Search should skip this file's contents when building its search index
Offline (O)Data is not stored locally (for example a cloud placeholder)
TemporaryA file meant to be short-lived
SparseA file with large empty stretches that do not use clusters
Reparse pointThe file is a link or special item (Section 6)

Seeing everything: In PowerShell, (Get-Item notes.txt).Attributes lists them all in words. In Properties → General → Advanced... you find "Index this file for faster searching" (the opposite of Not-content-indexed), compression and encryption.

Summary

TermPlain meaning
AttributeAn on/off switch stored with a file's metadata
Read-only (R)Asks programs not to change the file; easy to clear
Hidden (H)Not shown in normal folder views; not a security feature
System (S)Marks an operating-system file
Archive (A)"Changed since the last backup" marker
Compressed (C)NTFS squeezes the data and unpacks it on read
Encrypted (E)EFS scrambles the data using a key tied to your account
Not content indexed (I)Skip the file's contents in Windows Search
attribCommand that shows and changes attributes