Operating Systems

A technician is connected to a PC through a remote command prompt and must confirm which machine it is. Which command returns just the computer name and nothing else?

Show the answer

Correct answerA. hostname

AWhy this is right: It prints the local computer name on a single line and nothing more.

BWhy not this: It reports the signed-in account, usually with a prefix, rather than only the computer name.

CWhy not this: It lists or manages local user accounts and does not report the computer name.

DWhy not this: It opens a dialog with the Windows version and build, not a console name.

hostname prints only the computer's name. whoami reports the signed-in account, usually as computer\user, so it is not a name-only result, and it exists to identify the user.