Attrib Command
Manage file attributes like Read-only, Hidden, and System.
Start Interactive LessonThe attrib command displays, sets, or removes attributes assigned to files or directories. These attributes control how the operating system interacts with files—making them read-only to prevent editing, hiding them from view, or marking them as system files.
Try changing file attributes!
Common Attributes
- Read-only (R): Prevents the file from being modified or deleted.
- Hidden (H): Hides the file from standard directory listings (though
dir /awill still show it). - System (S): Marks the file as a critical system file.
Real-World Examples
1. Making a file Read-only
Protect an important document from accidental changes.
Check the attribute:
2. Hiding a private folder
Hide a folder from casual view.
3. Removing all attributes from all files in a folder
Useful when recovering files from a backup that might have weird permissions set.
Knowledge Check
1 / 3Which flag makes a file Read-Only?
References
These documentation links provide authoritative details for the commands used in this article.