$M in PROMPT

  • This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.
Nov 13, 2008
17
0
#1
Is there a way to display the remote name associated with a drive like cmd.exe? In cmd.exe's prompt, $M Displays the remote name associated with the current drive letter or the empty string if current drive is not a network drive.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,376
39
Albuquerque, NM
prospero.unm.edu
#2
Is there a way to display the remote name associated with a drive like cmd.exe? In cmd.exe's prompt, $M Displays the remote name associated with the current drive letter or the empty string if current drive is not a network drive.
You can embed functions and internal variables in the prompt string, nesting them to create some fairly elaborate effects. Remember to put strong quotes around the definition, or else double the percent signs.

Code:
prompt `%@truename[%_cwd]$g`
Code:
prompt `$P%@if[%@remote[%_disk:] == 1, - %@truename[%_disk:],]$g`
 

rconn

Administrator
Staff member
May 14, 2008
10,096
85
#4
holla wrote:

> Is there a way to display the remote name associated with
> a drive like cmd.exe? In cmd.exe's prompt, $M Displays the
> remote name associated with the current drive letter or the
> empty string if current drive is not a network drive.

$M is already used in TCC to display the time.

In TCC, you can use the @TRUENAME and/or @UNC functions in your prompt
to display the remote name.

Rex Conn
JP Software