Difficulty: Easy
Correct Answer: RD
Explanation:
Introduction / Context:
File and directory management in MS-DOS uses simple commands with specific behaviors. Deleting a directory safely requires knowing which command enforces the “empty only” rule, preventing accidental removal of content. This is especially important when scripting batch operations that manipulate directory trees.
Given Data / Assumptions:
Concept / Approach:
The RD (or RMDIR) command removes an empty directory. If files or subfolders exist, RD fails, protecting contents by default. DEL/ERASE act on files, not directories. MD creates a directory rather than removing it. For recursive deletions, DOS provided DELTREE, but that is outside this question's scope and purposely riskier.
Step-by-Step Solution:
Verification / Alternative check:
Typing HELP RD or RD /? in DOS explains that RD removes a directory, failing if it contains files. This matches the requirement precisely.
Why Other Options Are Wrong:
Common Pitfalls:
Final Answer:
RD.
Discussion & Comments