6
Jan/09
0

Change windows command prompt

Changing the command prompt is not only possible in Linux. You can also change the look of your prompt on windows and also dos systems. Following I describe changing the prompt in Windows 2000 and above (Tested in XP and 2003).

You can change the appearance of your windows command prompt in the registry via regedit (Start > Run > regedit > Enter). Then browse to the registry key:

HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment

There create a new option of type REG_EXPAND_SZ (Expanded String Value) named PROMPT.

Now double click the new option and add a value which defines your prompt. You can use the following macros and other global environment variables like %COMPUTERNAME%.

Prompt Macro Sign
$A & (Ampersand)
$B | (Pipe)
$C ( left parenthesis
$F ) right parenthesis
$D Date in system date format
$E Escape code (ASCII Code 27)
$G > greater than
$L < less than
$H Backspace
$N Current drive
$P Current drive with path
$Q = Equal sign
$S Space
$T Current time
$V Windows NT version number
$_ Carriage return
$$ $ Dollar sign

Useful environment variables are for example:

Variable Description
%USERNAME% Current username
%COMPUTERNAME% Local computer name
%USERDOMAIN% Local domain name

The new prompt will be applied on next re-logon.

You can test your prompt string by open a command line (Start > Run > cmd > Enter) and then enter “prompt <your prompt string>

My favorite prompt is: $P$_$G$S

This looks as follows:

C:\WINDOWS
>
Filed under: Windows
Comments (0) Trackbacks (0)

No comments yet.

No trackbacks yet.