DOS – Change your command line prompt

Sometimes you do not want people knowing the current path you work on or from which directory you invoke commands in Windows Command Line (or previously known as DOS). The prompt command allows you to change the command prompt temporarily.

Our Default Prompt

Our default is follow this format [drive]:\

For instance, I have this Windows command line screen.


Now there is nothing wrong with this. However, when you are in a particular directory you may feel I bit uncomfortable sharing an image (photo) of that screen.

For instance, your Windows user name is shown on this image.


Another case is when you changed to some other directory and “work” in there.


Hide your prompt

There is a simple trick in DOS. By using the prompt command, we hide our command prompt.


Even if you change to another directory, the new location will not be displayed on the screen.


Karl San Gabriel

Karl San Gabriel

Java and Enterprise Technologies Expert