How to get current 'prompt' string?

Apr 7, 2010
42
0
My batch script needs to prepend a string to the current prompt string ... to identify the current virtual environment, similar to activating a python virtual environment.

CMD.EXE sets the PROMPT environment variable; TCC does not.

Is there a way to get the current prompt string?
 
Apr 2, 2011
1,607
15
55
North Carolina, USA
I believe if there is no Env. variable PROMPT then it defaults to $P$G else you can just ECHO %PROMPT%
 
I believe if there is no Env. variable PROMPT then it defaults to $P$G else you can just ECHO %PROMPT%
Actually, if there is no Prompt environment variable the default string is [$p$g]
The brackets are part of the string and the p must be lowercase. An uppercase P would display the entire path in uppercase.

-- Howard