缩短 Windows 10 命令提示符

mem*_*nuk 2 windows path command-line windows-10

我试图弄清楚如何缩短 Windows 10 中的提示,这样我最终不会得到一个深度嵌套的目录路径,它占用了大部分(或全部)命令行。

我已经尝试应用此处显示的信息,但它似乎没有正确转换为 Windows 10。我创建了一个新的环境变量,命名PROMPT并填写了适用的信息,但它似乎没有达到预期的效果 - 它只向下移动>一行;还有很长的路要走。

Red*_*ick 5

C:\Program Files\Internet Explorer\en-US>PROMPT=$N$G$S

C> ver

Microsoft Windows [Version 10.0.10586]

C>
Run Code Online (Sandbox Code Playgroud)

我怎么做那根棍子?

简单的方法

C> setx PROMPT $n$g$s

SUCCESS: Specified value was saved.
Run Code Online (Sandbox Code Playgroud)

然后关闭并重新打开命令提示符。

艰辛的道路

Win+ Break、“高级系统设置”、“环境变量”...

在此处输入图片说明

在此处输入图片说明


笔记:

The prompt text can be made up of normal characters and the following special codes:

   $A  &           (Ampersand) 
   $B  |           (pipe) 
   $C  (           (Left parenthesis) 
   $D Current date 
   $E Escape code  (ASCII code 27) 
   $F  )           (Right parenthesis) 
   $G  >           (greater-than sign) 
   $H  Backspace   (erases previous character) 
   $L  <           (less-than sign) 
   $M  Display the remote name for Network drives
   $N  Current drive 
   $P  Current drive and path 
   $Q  =           (equal sign) 
   $S              (space) 
   $T  Current time 
   $V  Windows NT version number 
   $_  Carriage return and linefeed 
   $$  $           (dollar sign)
   $+  Will display plus signs (+) one for each level of the PUSHD directory stack
Run Code Online (Sandbox Code Playgroud)