How can I shorten the path of a DOS prompt?

前端 未结 4 758
春和景丽
春和景丽 2020-12-23 10:21

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>
         


        
4条回答
  •  遥遥无期
    2020-12-23 10:48

    Here is a .bat file that displays the prompt with the final folder name in the current dir path.

    for %%* in (.) do set CurrDirName=%%~nx*
    echo %CurrDirName%
    prompt %CurrDirName% $G
    

    Lines 1 and 2 come from This answer to SuperUser: "How can I find the short path of a Windows directory/file?"

提交回复
热议问题