Revision 5: Cleanup & Attributes
Master folder deletion and file attribute modification for better system housekeeping.
Start Interactive LessonRevision 5: Cleanup & Attributes
System maintenance is critical — removing unnecessary files and protecting important ones. In this revision, you'll combine the rd (remove directory) and attrib (attributes) commands to clean up your workspace and secure key files.
Challenge 1: Recursive Cleanup
Use rd with /S (recursive) and /Q (quiet mode) to delete a cache folder and all its contents in one command. This is essential for maintenance — preventing confirmation prompts lets you automate cleanup tasks.
The /S flag ensures recursive deletion — all subdirectories and files inside cache are removed. The /Q flag suppresses confirmation dialogs, perfect for batch operations.
Challenge 2: File Protection
Now protect an important file by making it read-only using the attrib command. This prevents accidental modifications.
The R (Read-Only) attribute in the directory listing shows that settings.ini is now protected. Attempting to delete or modify it will fail until you remove this attribute with attrib -R.
Knowledge Check
1 / 4What does the /S flag do with the RD command?
References
These Microsoft Learn and Windows documentation links provide authoritative details for the commands used in this article.