•Arnošt Havelka
Practical: Attributes
Real-world scenario: Securing and hiding sensitive files.
Start Interactive LessonPractical: File Attributes
Sometimes files need to be protected from accidental deletion or hidden from prying eyes. In this scenario, we'll secure a "Secret" project folder.
The Mission
You have a file passwords.txt that should be hidden, and a contract.docx that must never be modified (Read-only).
Step 1: Hide the Passwords File
Make the file disappear from standard directory listings.
Command Prompt
C:\Users\User>attrib +h passwords.txt
Step 2: Verify it's Hidden
Use dir to see it's gone, then dir /a to reveal it.
Command Prompt
C:\Users\User>dir
Step 3: Make the Contract Read-Only
Prevent edits to the contract.
Command Prompt
C:\Users\User>attrib +r contract.docx
Step 4: Try to Delete the Contract
See what happens when you try to delete a read-only file.
Command Prompt
C:\Users\User>del contract.docx
Knowledge Check
1 / 3Which attribute hides a file?