220-1102 exam dumps

220-1102 practice question 117 of 828

A+ Core 2. Associate level, CompTIA. Free question with the correct answer and a full explanation.

220-1102 Question 117

Single answerrmdir

A technician is cleaning up a Windows 10 workstation after removing an old application. The folder C:\AppData\OldTool contains several empty subfolders left behind by the uninstall process. The technician wants to remove the entire empty directory structure from Command Prompt without deleting any files elsewhere. Which command should the technician use?

  1. A

    rmdir C:\AppData\OldTool

  2. B

    rmdir /s C:\AppData\OldTool

  3. C

    del /s C:\AppData\OldTool

  4. D

    erase C:\AppData\OldTool*.*

Show answer and explanation

Correct answer: B

Explanation

On Windows systems, rmdir (also available as rd) is the command used to remove directories. Without switches, it can delete only an empty directory. When a folder contains subdirectories, even if those subdirectories are empty, the parent directory is not considered empty. The /s switch removes the specified directory together with all subdirectories and files beneath it. In real support scenarios, technicians should verify the path carefully before using /s because it performs recursive deletion. Microsoft command documentation for rd/rmdir explains that /s removes a directory tree, while del and erase are intended for files rather than folders.

  • A. Incorrect.

    This command removes a directory only if it is empty. In this scenario, the main folder contains several empty subfolders, so the top-level directory is not considered empty yet. As a result, this command would fail unless each subfolder were removed first.

  • B. Correct.

    This is correct. In Windows Command Prompt, rmdir (or rd) with the /s switch removes the specified directory and all subdirectories beneath it. Because the remaining structure contains only empty folders, this command removes the entire directory tree in one step. It is appropriate when the goal is to delete a folder hierarchy rather than individual files.

  • C. Incorrect.

    This is incorrect because del is used to delete files, not directories. The /s switch with del processes files in subdirectories, but it does not remove the folders themselves. A technician might choose this option if they confuse file deletion with folder removal.

  • D. Incorrect.

    This is incorrect because erase, like del, deletes files rather than directories. Using a wildcard such as . targets files inside the folder, but it does not remove the directory structure itself. This is a common misconception when cleaning up leftover application folders.

Timed practice exam

Take a 220-1102 practice test under exam conditions

90 questions in 90 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam