windows cmd with too long prompt

Posted on


When I go to a deep directory in MS Windows cmd, the prompt is too long since it show the full name of the working directory.

How to make it hide the directory name or at least part of it?


prompt $g will replace the long path with a beautiful


You can also customize it as you wish, type prompt /? for help.

@Revolter’s answer is the cleanest. You can also use the subst command to associate a path with a drive letter. For example, subst x: . will associate the x: drive with the working directory. Next, enter x: to switch to your ‘new’ working directory. This helps tidy up the command prompt. subst x: /d will delete the association. subst by itself will show all your pairings.

Check out this post by Scott Hanselman. It shows how to get a more sensible dos prompt.

Leave a Reply

Your email address will not be published. Required fields are marked *