Way to limit cmd shell prompt length

D

David

Hi,

I am looking for a way to limit the displayed command shell prompt
when environment variable "PROMPT" is set to "$P$G". Note that I do
not want to limit the actual directory length or anything like that -
all I need is to display only the rightmost 10 or so characters of the
path/directory names as the prompt.

Thanks,

David
 
K

Kelly

Hi David,

Not really sure what you are after. Suggestions:

Go to Start/Run/Regedit and navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session
Manager\Environment

Add or modify the string value named PROMT in the right pane. For the value
use:

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 XP version number
$_ - Carriage return and linefeed
$$ - $ (dollar sign)

Variables
%USERNAME% - Current Username
%COMPUTERNAME% - Local computer name
%USERDOMAIN% - Local domain name

The default prompt is "$P$G" (e.g. "C:\>"), some examples include:
[%computername%]$S$P$G to show the computer, drive and path
[%username%]$S$P$G to show the current user, drive and path

Restart or log-off Windows will be required for the change to take effect.
 
D

David

Hi David,
Not really sure what you are after. Suggestions:
Hi Kelly, thanks for replying.

What I am looking for is a way (? registry entry ?) of having a
command prompt that will give me an abbreviated version of what $P$G
gives me.

Eg, at the moment I get :

"C:\Documents and Settings\All Users\Documents\My Pictures\Sample
Pictures>"

for a command prompt and I find the feedback as to the current
directory to be very useful but the problem is the PROMPT takes up
most of a line which is a bit clumsy. What I'd like is a way of only
showing "N" characters from this PROMPT as follows :

"C:\Doc...res\Sample Pictures>"

I assume from your reply that there is no way of doing this ?

Thanks,

David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top