PDF download Download Article PDF download Download Article

The windows command prompt (located at C:\Windows\System32\cmd.exe) is a useful tool to perform various administrative tasks. The prompt is a string of characters (special and non special) that are displayed whenever the command prompt is waiting for input. Making the prompt less boring or more useful can make a lot of difference when working with the command prompt. It can be changed dynamically using the 'prompt' command, or permanently by creating a %prompt% user variable.

Method 1
Method 1 of 2:

Changing the prompt dynamically

PDF download Download Article
  1. Advertisement
  2. 4
    The new prompt is displayed at the new line.
  3. Advertisement

Note that this only changes the prompt of the current command prompt session, which is reset the next time you run the command prompt.

Method 2
Method 2 of 2:

Changing the prompt permanently

PDF download Download Article
  1. Advertisement

Community Q&A

Search
Add New Question
  • Question
    How do I make a website you can't get off of?
    Community Answer
    Community Answer
    You can't do that. Simple as that. Why would you want to do that, anyway? It doesn't make sense.
Ask a Question
200 characters left
Include your email address to get a message when this question is answered.
Submit
Advertisement

Video

Tips

There are special character sequences that can be used in the prompt string to display different variables. The 'prompt /?' command displays a list of these special characters. Environmental variables can also be used in the prompt string, using the standard format % variablename%.

The default prompt is "$P$G" which simply means "Display the current drive and path ($P), followed by a ">" ($G). For example C:\Windows>. Following is the list of possible special characters.


$A & (Ampersand) $B | (pipe) $C ( (Left parenthesis) $D Current date $E Escape code (ASCII code 27) $F ) (Right parenthesis) $G > (greater-than sign) $H Backspace (erases previous character) $L < (less-than sign) $N Current drive $P Current drive and path $Q = (equal sign) $S (space) $T Current Time $V Windows version number $_ Carriage return and linefeed $$ $ (dollar sign)

If Command Extensions are enabled the PROMPT command supports the following additional formatting characters:

$+ zero or more plus sign (+) characters depending upon the depth of the PUSHD directory stack, one character for each level pushed.

$M Displays the remote name associated with the current drive letter or the empty string if current drive is not a network drive.

Submit a Tip
All tip submissions are carefully reviewed before being published
Name
Please provide your name and last initial
Thanks for submitting a tip for review!
Advertisement

Warnings

  • Avoid typing random gibberish in the command prompt. The Command Prompt is a powerful tool which can make permanent irreversible changes to your computer. It's quite possible to delete all the data on your computer!
Advertisement

You Might Also Like

Change Colours in Command Prompt Change Colours in Windows Command Prompt
Use CMD (Beginner) Use CMD Command Lines as a Beginner
Customize the Font in Windows Command Prompt Customize the Font in Windows Command Prompt
Use MS DOS Use MS DOS
Find All Commands of CMD in Your Computer Display and Use CMD Commands: A List and Guide
Change Directories in Command Prompt Navigate to a Different Folder in the Command Prompt
Change a Computer Password Using Command Prompt Change a Windows Password Using Command Prompt
Open a Folder in Cmd Open a Folder in Command Prompt (CMD)
Change the Computer Time and Date Using the Command PromptChange the Computer Time and Date Using the Command Prompt
Run Command Prompt As an Administrator on Windows4 Ways to Run the Command Prompt as an Administrator in Windows
Change the PATH Environment Variable on Windows Change the PATH Environment Variable on Windows
Open the Command Prompt in Windows6 Simple Ways to Open the Command Line in Windows
Run a Program on Command Prompt Run a Program at the Windows Command Prompt: 2 Ways
Boot to Command PromptBoot to Command Prompt
Advertisement

About This Article

Tested by:
wikiHow Technology Team
wikiHow is a “wiki,” similar to Wikipedia, which means that many of our articles are co-written by multiple authors. To create this article, 24 people, some anonymous, worked to edit and improve it over time. This article has been viewed 192,523 times.
How helpful is this?
Co-authors: 24
Updated: March 14, 2025
Views: 192,523
Categories: Command Prompt
Thanks to all authors for creating a page that has been read 192,523 times.

Is this article up to date?

Advertisement