Is it possible to extend the windows cmd prompt, by prepending a string to the current prompt?
If I would use bash, I would write something like PS1="XXX $PS1"
Is there a similar possibility for the Windows command prompt?
PROMPT "String %PROMPT%"
The current prompt is stored, as you may have guessed, in the %PROMPT% environment variable. Using that in the prompt command will keep the existing prompt.
Yes.
set "PROMPT=XXX %PROMPT%"
See also:
I've solved it!
The prompt is also available using the environment variable PROMPT.
Hence I can do a
set PROMPT=XXX %PROMPT%