Which command would you use to change a file's attribute to read-only?

Prepare for the DOS Professionhood Exam with our comprehensive quiz. Engage with flashcards and multiple-choice questions, each equipped with hints and explanations. Master your exam content!

Multiple Choice

Which command would you use to change a file's attribute to read-only?

Explanation:
The command that changes a file's attribute to read-only is the one that uses the ATTRIB command with the +R switch followed by the filename. The ATTRIB command is a built-in command in MS-DOS and Windows command line that allows users to view or modify the attributes of a file or directory. When you use the +R switch, it sets the read-only attribute on the specified file, preventing it from being modified or deleted without first changing its attribute back. The other options do not reflect actual command syntax used in DOS or Windows. SETATTR, CHANGEATTR, and MODIFY are not standard commands recognized by these operating systems for managing file attributes. Thus, they would not successfully change a file's attribute to read-only, making the first option the correct and valid choice for this action.

The command that changes a file's attribute to read-only is the one that uses the ATTRIB command with the +R switch followed by the filename. The ATTRIB command is a built-in command in MS-DOS and Windows command line that allows users to view or modify the attributes of a file or directory. When you use the +R switch, it sets the read-only attribute on the specified file, preventing it from being modified or deleted without first changing its attribute back.

The other options do not reflect actual command syntax used in DOS or Windows. SETATTR, CHANGEATTR, and MODIFY are not standard commands recognized by these operating systems for managing file attributes. Thus, they would not successfully change a file's attribute to read-only, making the first option the correct and valid choice for this action.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy