Pcornel
Browse topics
Options
Recent
Favorites
Windows · Technical reference

File Attributes

Direct answer

File attributes are flags such as Read-only, Hidden, System, Archive, Compressed and Encrypted. View and change them with attrib or Get-Item | Select Attributes.

When to use this

Use this when files are hidden, read-only or behave oddly because of attributes.

First 30 seconds

1. Get-Item <file> | Select Attributes.

2. attrib <file> — R, H, S, A.

3. Read-only blocking writes → attrib -r.

4. Hidden/system → Get-ChildItem -Force.

5. Archive bit used by some backups.

Operational verification

file attributes stored with the file → honoured by tools

Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common mistakes
  • Malware hiding files with +h +s, so they are invisible in Explorer.
  • Read-only attribute mistaken for permissions (it does not stop admins).
  • Archive bit used by old backup tools while modern tools use change journals.
Platform / version applicability
Microsoft Windows
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

PlatformMicrosoft Windows
Key commandGet-Item file.txt | Select-Object Attributes
Scope / prerequisiteUse this when files are hidden, read-only or behave oddly because of attributes.
What next?2 suggested next steps
Evidence1
On this pageJump to a specific section
Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • Read-only prevents edits until cleared.
  • Hidden plus System hides files even with hidden items shown.
  • Some backup tools use the Archive bit.
Key checks
  • Get-Volume — volumes, filesystem type, health and free space
  • fsutil fsinfo volumeinfo C: — filesystem features
  • chkdsk C: /scan — online scan
  • Get-WinEvent -FilterHashtable @{LogName='System';ProviderName='Ntfs'} -MaxEvents 20 — NTFS events
ReferenceHow it works1 section · depth on demand

In depth

File attributes control behaviour beyond permissions:

AttributeFlagEffect
Read-onlyRPrevents writes (folders: ignored by Explorer for customisation)
HiddenHHidden in normal listings
SystemSOS file, hidden with "protected OS files"
ArchiveAChanged since last backup
Compressed / EncryptedC / ENTFS compression / EFS
Offline / Recall on openO / MFiles On-Demand (OneDrive), HSM
Not content indexedIExcluded from search index
attrib +h +s C:\Data\secret.txt
Get-Item C:\Data\file.txt | Select Attributes
ReferenceImportant terms & boundaries1 section · depth on demand

Attribute flags

FlagMeaning
RRead-only
HHidden
SSystem
AArchive (changed since backup)
INot content indexed
P / UPinned / unpinned (OneDrive Files On-Demand)
OOffline

attrib +h +s file hides a file from normal listings; dir /a shows it.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
ReferenceConfiguration & state1 section · depth on demand

Commands

attrib file.txt                   # show attributes
attrib +h +r file.txt             # set Hidden and Read-only
Get-Item file.txt | Select-Object Attributes
(Get-Item file.txt).Attributes += 'Hidden'
AttributeMeaning
RRead-only (on folders it is mostly ignored by Explorer)
HHidden
SSystem file
AArchive: changed since last backup
C / ENTFS compressed / EFS encrypted

Hidden files are still visible with dir /a or Get-ChildItem -Force.

Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docMicrosoft Windows current

Authoritative/upstream documentation reviewed for bounded claims in Filesystem → File Attributes. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://learn.microsoft.com/en-us/windows-server/storage/file-server/ntfs-overview · confidence 94%
Confirmation

Confirm action

Continue?