CMD Master
Back to Blog
Arnošt Havelka

Practical: Attributes

Real-world scenario: Securing and hiding sensitive files.

Start Interactive Lesson
Practical: 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.

Terminal
C:\Users\Student>attrib +h passwords.txt

Step 2: Verify it's Hidden

Use dir to see it's gone, then dir /a to reveal it.

Terminal
C:\Users\Student>dir

Step 3: Make the Contract Read-Only

Prevent edits to the contract.

Terminal
C:\Users\Student>attrib +r contract.docx

Step 4: Try to Delete the Contract

See what happens when you try to delete a read-only file.

Terminal
C:\Users\Student>del contract.docx

Knowledge Check

1 / 3

Which attribute hides a file?

References

These documentation links provide authoritative details for the commands used in this article.

Up Next

Revision 6: Automation & File Comparison

Create batch scripts and compare files to master advanced file operations.