How do I change the command-line prompt in Windows?

user1243746 picture user1243746 · Aug 19, 2012 · Viewed 70.5k times · Source

How do I change the command-line prompt into a console?

I've been looking in the console functions API, but I could not find anything for it.

Answer

Marc B picture Marc B · Aug 19, 2012

There's the PROMPT environment variable:

set PROMPT=$P$G

$P$G is the default value, giving you the usual C:\> type output. There are more format variables available here.