In MS-DOS, which command customizes the command-line prompt so it can display information such as drive, path, or time?

Difficulty: Easy

Correct Answer: prompt

Explanation:


Introduction / Context:
The default DOS prompt (e.g., C:>) can be enhanced to show additional context like the current path, time, or special characters. This is helpful for administrators who navigate deep directory trees or maintain multiple drives. DOS provides a built-in command for defining the prompt's format string.


Given Data / Assumptions:

  • We are customizing the interactive shell prompt in COMMAND.COM.
  • Need to include dynamic elements (drive, path, time).
  • No third-party shells are assumed.


Concept / Approach:

The PROMPT command accepts format codes such as $P (current drive and path), $G (>), $T (current time), $D (date), and more. For example, PROMPT $P$G yields a prompt that displays the full path followed by >. This can be placed in AUTOEXEC.BAT for persistence. Other listed terms (windows, cursor, click) are not DOS commands for prompt customization.


Step-by-Step Solution:

Identify the DOS facility for customizing the shell prompt.Recall PROMPT syntax and format variables ($P, $G, $T, $D).Construct a desired string (e.g., PROMPT $T $P$G).Apply it interactively or in AUTOEXEC.BAT.


Verification / Alternative check:

Typing PROMPT /? lists all supported tokens, confirming how to display drive, path, time, and other context in the prompt line.


Why Other Options Are Wrong:

  • windows, cursor, click: not DOS configuration commands.
  • None of the above: incorrect because PROMPT is correct and built-in.


Common Pitfalls:

  • Forgetting to escape special characters or include $G for the familiar > symbol.
  • Not adding the PROMPT line to AUTOEXEC.BAT, causing settings to reset at reboot.


Final Answer:

prompt.

More Questions from Disk Operating System (DOS)

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion