I'm working on Windows 7 using the cmd console. How do I hide the path in the prompt?

  • why do you want to? – soandos Jul 26 '11 at 16:38
  • real-estate ... – Chris Jul 26 '11 at 16:40
  • Sorry, dont follow. You mean you want to see more on the screen? – soandos Jul 26 '11 at 16:41
  • 2
    That's what he means, exactly. – cularis Jul 26 '11 at 17:01
  • 2
    @barlop, I believe real estate is a fairly standard way to refer to the space available on the screen - e.g. bing.com/… – dsolimano Jul 26 '11 at 19:24

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
| improve this answer | |
  • 8
    I feel FREE!!!! – Chris Jul 26 '11 at 17:09
  • 3
    Is there a way to make this stick ie become default? – Chris Moutray Aug 20 '14 at 13:36

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 "".

| improve this answer | |
  • 1
    This should be the accepted answer. Thanks @Ben N – Pramesh Bajracharya Jun 27 '17 at 3:12

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.