How do I hide the path in command line prompt on Windows?
Rise to the top 3% as a developer or hire one of them at Toptal: https://topt.al/25cXVn
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Forest of Spells Looping
--
Chapters
00:00 How Do I Hide The Path In Command Line Prompt On Windows?
00:15 Accepted Answer Score 67
00:31 Answer 2 Score 8
00:52 Answer 3 Score 10
01:33 Thank you
--
Full question
https://superuser.com/questions/315354/h...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#commandline #path #prompt
#avk47
ACCEPTED ANSWER
Score 67
You can use
prompt [text]
command. Type prompt /?
to list all of the available parameters. For example, the following command sets "> (greater-than sign)" as prompt.
prompt $g
ANSWER 2
Score 10
The command prompt $g
will indeed set the prompt to a single >
sign. For a full list of special codes you can use there, see prompt /?
.
If you want the custom prompt to apply automatically when you start a command prompt, you can set the PROMPT
environment variable. That can be accomplished in the normal Windows UI, or by using the setx
command. For example, this sets the prompt to >
:
setx PROMPT $g$s
On the next launch of the command prompt, you'll see your new prompt.
To restore the normal Windows prompt for one session, type prompt
. To restore the default for all sessions by removing the environment variable, type setx PROMPT ""
.
ANSWER 3
Score 8
Some more tips:
If you want to go back to previous status (showing full path), just type prompt
without any arguments, and press Enter. If you just want to see current working directory (the same as pwd
in linux), type chdir
or cd
without any arguments and press Enter.