Skip to content

PROMPT Windows Command Guide

The Windows prompt command allows users to customize the appearance of the command prompt window, making it more personalized and efficient. By using various parameters and variables, users can display information such as the current date, time, drive, directory, and more. Understanding how to utilize the prompt command can enhance productivity and streamline the command-line experience.

Terminal window
CommandSyntax
OptionDescription
Option1Description of option1
Option2Description of option2
Option3Description of option3
ParameterDescription
Parameter1Description of parameter1
Parameter2Description of parameter2

Change Prompt to Display Current Directory

Section titled “Change Prompt to Display Current Directory”
Terminal window
prompt $p$g

Changes the prompt to display the current directory.

Terminal window
prompt $p$g

Resets the prompt to default settings, displaying only the current directory.

Terminal window
prompt $t$g

Customizes the prompt to display the time followed by the greater-than sign.

Terminal window
prompt $n$g

Sets the prompt to display the current username.

Terminal window
prompt $d$g

Configures the prompt to show the date.

Setting the Prompt to Display a Special Character

Section titled “Setting the Prompt to Display a Special Character”
Terminal window
prompt =$g

Configures the prompt to display a custom special character.

Terminal window
prompt $t $n $g

Sets the prompt to display the current time, username, and a greater-than sign.

To use the prompt command in Windows, execute the following command:

Terminal window
prompt --option <value>

How can I change the text displayed in the Windows command prompt?

Section titled “How can I change the text displayed in the Windows command prompt?”

To change the text displayed in the Windows command prompt, you can use the prompt command with the desired text enclosed in quotation marks. For example:

Terminal window
prompt "Custom Prompt>"

How do I display the current date in the Windows command prompt?

Section titled “How do I display the current date in the Windows command prompt?”

To display the current date in the Windows command prompt, you can use the prompt command with the $D variable. For example:

Terminal window
prompt $D $T

Can I customize the color of the Windows command prompt?

Section titled “Can I customize the color of the Windows command prompt?”

Yes, you can customize the color of the Windows command prompt using the prompt command with color codes. For example, to set the text color to green, you can use:

Terminal window
prompt $E[92m

How do I reset the Windows command prompt to the default settings?

Section titled “How do I reset the Windows command prompt to the default settings?”

To reset the Windows command prompt to the default settings, you can use the prompt command with the default flag. For example:

Terminal window
prompt $P$G

Is it possible to add line breaks to the Windows command prompt?

Section titled “Is it possible to add line breaks to the Windows command prompt?”

Yes, you can add line breaks to the Windows command prompt using the prompt command with the $n variable. For example:

Terminal window
prompt Line 1$nLine 2
  • Customize the command prompt appearance
  • Display specific information like time, date, current directory in the command prompt
  • Change the command prompt text color and background color
  • Show/hide drive and path in the command prompt
  • Customize the command prompt with a specific message
  • Set a specific title for the command prompt window