How to customize the WS 2003 command prompt?

  • Thread starter Thread starter David Brockus
  • Start date Start date
D

David Brockus

Guest
Hello,

I would like to have a command prompt that includes

<username>@<computername> <current_drive_letter><current_path>
dbrockus@whaterverhost c:\

I am unable to get %USERNAME% and %COMPUTERNAME% to work when I am setting
the PROMPT environment variable. The Command Prompt prints the variable name
instead of the value. When I do an echo at a prompt for the variable name I
get the values back so I know they are correctly defined.

Any ideas?

Thanks,
David
 
Re: How to customize the WS 2003 command prompt?


"David Brockus" <dbrockus@community.nospam> wrote in message
news:93D260B8-2C46-4D97-B2CA-36448E4F70C6@microsoft.com...
> Hello,
>
> I would like to have a command prompt that includes
>
> <username>@<computername> <current_drive_letter><current_path>
> dbrockus@whaterverhost c:\
>
> I am unable to get %USERNAME% and %COMPUTERNAME% to work when I am setting
> the PROMPT environment variable.


I just did it from Win2003 Server so show us the
command you are using.

prompt %username%@%computername% $p$g

BTW: Do you have any idea how obnoxious such a long (minimum) prompt
is likely to be?

Who doesn't know their own name and which computer they are own?
(and yes, I use TS and RDP a lot.)

> The Command Prompt prints the variable name
> instead of the value. When I do an echo at a prompt for the variable name
> I
> get the values back so I know they are correctly defined.


prompt %username%@%computername% $p$g
 
Re: How to customize the WS 2003 command prompt?

Hello,

Sorry I should have elaborated. I am trying to set "PROMPT" as a System
variable in the Advanced tab of the Properties in the Control Panel.

My value is %username%@%computername%$s$p$g

When I start a command prompt, the prompt is literally this:
%username%@%computername% C:\Documents and Settings\dbrockus>

If I do a 'prompt' or a 'set PROMPT=' from Command Prompt and set the value
it does work. I would like to be able to define it as a global environment
variable.

Thoughts?

David
"Herb Martin" wrote:

>
> "David Brockus" <dbrockus@community.nospam> wrote in message
> news:93D260B8-2C46-4D97-B2CA-36448E4F70C6@microsoft.com...
> > Hello,
> >
> > I would like to have a command prompt that includes
> >
> > <username>@<computername> <current_drive_letter><current_path>
> > dbrockus@whaterverhost c:\
> >
> > I am unable to get %USERNAME% and %COMPUTERNAME% to work when I am setting
> > the PROMPT environment variable.

>
> I just did it from Win2003 Server so show us the
> command you are using.
>
> prompt %username%@%computername% $p$g
>
> BTW: Do you have any idea how obnoxious such a long (minimum) prompt
> is likely to be?
>
> Who doesn't know their own name and which computer they are own?
> (and yes, I use TS and RDP a lot.)
>
> > The Command Prompt prints the variable name
> > instead of the value. When I do an echo at a prompt for the variable name
> > I
> > get the values back so I know they are correctly defined.

>
> prompt %username%@%computername% $p$g
>
>
>
 
Re: How to customize the WS 2003 command prompt?


"David Brockus" <dbrockus@community.nospam> wrote in message
news:245A15BF-9B97-4746-8626-B09862AC4E04@microsoft.com...
> Hello,
>
> Sorry I should have elaborated. I am trying to set "PROMPT" as a System
> variable in the Advanced tab of the Properties in the Control Panel.


I was going to say use a logon script but I am not sure that would work.

Have you tried doing it for a SINGLE user in the environment that way?

If so, then a logon script can (be make to) work.

> My value is %username%@%computername%$s$p$g
>
> When I start a command prompt, the prompt is literally this:
> %username%@%computername% C:\Documents and Settings\dbrockus>


That's because those environment variables don't get translated
coming out of the registry like that.

> If I do a 'prompt' or a 'set PROMPT=' from Command Prompt and set the
> value
> it does work. I would like to be able to define it as a global
> environment
> variable.
 
Back
Top