We can change our default DOS prompt in a command-line window. Sometimes we do not want people knowing the current path we work on or from which directory we invoke commands in a command-line window (DOS prompt). We can temporarily use the prompt command to hide it, which temporarily allows us to change the command prompt.
DOS is an ancient technology but remains a crucial part of the Microsoft Operating Systems. Nowadays, we refer to it as the Windows command-line or command-line window. It has its own unique set of commands allowing users to interact with Windows in a non-graphical way.
DOS is different from PowerShell, which has more capabilities.
Change from Our Default Prompt
Our default is to follow this format [drive]:\. For instance, we have this Windows command line screen.
There is nothing wrong with this. However, when we are in a particular directory, we may feel uncomfortable sharing an image (photo) of that screen. We may need to use a DOS command to change our command-line prompt. For example, your Windows user name may be visible on this image.
Another case is when you had changed to some other directory that contains confidential stuff.
Hide your DOS prompt in a command-line window
There is a simple trick in DOS by using the prompt command; we can hide our command prompt.
1 | prompt newprompt |
Even if we change to another directory, the new location will not be visible.