GCIA · Question #45
Adam, an expert computer user, doubts that virus named love.exe has attacked his computer. This virus acquires hidden and read-only attributes, so it is difficult to delete it. Adam decides to…
The correct answer is A. del /f /ah. The del command requires the /f switch to force-delete read-only files and the /a attribute switch with 'h' to target hidden files.
Question
Adam, an expert computer user, doubts that virus named love.exe has attacked his computer. This virus acquires hidden and read-only attributes, so it is difficult to delete it. Adam decides to delete virus file love.exe from the command line. He wants to use del command for this purpose. Which of the following switches will he use with del command to delete hidden and read only- files?
Options
- Adel /f /ah
- Bdel /q /ar
- Cdel /p /ar
- Ddel /q
How the community answered
(26 responses)- A77% (20)
- B12% (3)
- C8% (2)
- D4% (1)
Why each option
The del command requires the /f switch to force-delete read-only files and the /a attribute switch with 'h' to target hidden files.
The /f switch forces deletion of read-only files, overriding that protection, while /ah uses the attribute selector to target files with the hidden attribute set. Together they allow del to bypass both the hidden and read-only file protections on love.exe without requiring the attributes to be manually cleared first.
/q enables quiet mode to suppress confirmation prompts, and /ar selects read-only files by attribute, but this combination lacks the /f switch needed to actually force-delete a read-only file.
/p prompts the user for confirmation before each deletion and /ar selects read-only files, but /p is the opposite of a force-delete and the combination still does not address the hidden attribute.
/q only suppresses confirmation prompts for global wildcard deletions and does nothing to address either the hidden or read-only file attributes.
Concept tested: Windows del command attribute switches /f and /a
Source: https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/del
Topics
Community Discussion
No community discussion yet for this question.