Enggr
Enggr

Reputation: 627

I want to rename the command prompt screen from long path to short path or short name

I want to rename the command line path to a simple one so that I have more space to work on the window. Also it will keep the screen more neat

I want to rename the command prompt screen from

C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin\NETFX 4.0 Tools\x64

to

C:\NETFXPATH

I learned in my old days where you issue a command line ren xyz and the screen suddently becomes c:\xyz or xyz so that its easy to work on the screen.

How do I make this happen?

Upvotes: 0

Views: 170

Answers (2)

Stephan
Stephan

Reputation: 56155

No way to get something like your example. But you can get a short prompt (without any path) with

prompt $g 

which will only show ">" or if you only need more space to write your commands, you can add a Linefeed to prompt:

prompt $p$_ $g 

which will show the path (as the "usual" prompt), but gets input from the next line.

Upvotes: 0

Ken White
Ken White

Reputation: 125620

Unfortunately, that's not possible using the standard PROMPT command-line. It's not one of the options accepted by PROMPT:

J:\>prompt /?
Changes the cmd.exe command prompt.

PROMPT [text]

  text    Specifies a new command prompt.

Prompt 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)
  $N   Current drive
  $P   Current drive and path
  $Q   = (equal sign)
  $S     (space)
  $T   Current time
  $V   Windows version number
  $_   Carriage return and linefeed
  $$   $ (dollar sign)

If Command Extensions are enabled the PROMPT command supports
the following additional formatting characters:

  $+   zero or more plus sign (+) characters depending upon the
       depth of the PUSHD directory stack, one character for each
       level pushed.

  $M   Displays the remote name associated with the current drive
       letter or the empty string if current drive is not a network
       drive.

You could potentially work around it by creating junctions with MKLINK to shorten the path to the folder, or by using SUBST to map folders to a drive letter.

Upvotes: 1

Related Questions