Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I shorten the path of a DOS prompt?

Tags:

cmd

prompt

My path on my DOS prompt is ridiculously long. How can I shorten this?

C:\RUBY\Ruby_Practice\prep-work-master\coding-test-2\practice-problems\spec> 
like image 254
jingyang81 Avatar asked Aug 22 '13 22:08

jingyang81


People also ask

How do you shorten a path?

If you want to shorten a relative path that seems too long, you'll have to go to that path to make it current (i.e.: "."). Use PUSHD , CD , and POPD to go back and forth to a specific path in order to temporarily use a shorter relative path.

What is path command in DOS?

The path command specifies the location where MS-DOS should look when it executes a command. For example, if you were to use the "format" command, the path must be specified, or you will receive the message "bad command or file name." See our path definition for a full explanation and examples of paths on computers.


2 Answers

To remove the path from the prompt use 'prompt $g' which will just show the chevron. You can then use the 'cd' command anytime to see the directory you are in. E.g.

C:\Windows\System32\drivers\etc>prompt $g > >cd C:\Windows\System32\drivers\etc  > 
like image 75
Daniel Ellis Avatar answered Sep 30 '22 20:09

Daniel Ellis


Right-click on My Computer|Properties. Then from the Advanced Tab, click Environment Variables, then add a new User Variable called PROMPT and set it to $p$_$+$g.

http://www.hanselman.com/blog/ABetterPROMPTForCMDEXEOrCoolPromptEnvironmentVariablesAndANiceTransparentMultiprompt.aspx

like image 29
Jiminion Avatar answered Sep 30 '22 19:09

Jiminion