Announcement

Collapse
No announcement yet.

Command PROMPT fun

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Command PROMPT fun

    OK, I know the following:

    Originally posted by PROMPT command Help
    This system is protected. Please gain authority before use.
    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 XP 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.
    However is there any way to redirect the prompt string from a text file and put fancy control characters in so that it changes colours etc? If there are any clever "Old DOS hands" around please let me know!


    Tom
    For my own and your protection, I do not provide support by private message under any circumstances. All such messages will be deleted and ignored.

    Anything you say will be misquoted and used against you

  • #2
    Re: Command PROMPT fun

    Or alternatively does anyone know what to put after "$E" using the existing syntax, to change colours?

    Cheers!


    Tom
    For my own and your protection, I do not provide support by private message under any circumstances. All such messages will be deleted and ignored.

    Anything you say will be misquoted and used against you

    Comment


    • #3
      Re: Command PROMPT fun

      I remember escape sequences from my DEC VTxxx days.

      I recall DOS supported them through ANSI.SYS.

      Looks like support is limited in NT+:

      http://support.microsoft.com/kb/101875

      http://en.wikipedia.org/wiki/ANSI_escape_code

      You can also try the "color" command:

      color fc <or some other obnoxious combo>
      prompt This system is protected. Please gain authority before use.
      <pause or sleep n here>
      color <restores color to original>
      Cheers,

      Rick

      ** Remember to give credit where credit is due and leave reputation points sigpic where appropriate **

      2006-2099 R Valstar. This post is offered "as is" for discussion purposes only with no express or implied warranty of any kind including, but not limited to, correctness or fitness for use. Nothing herein shall be construed as advice. Attempting any activity based on information in this post is done at your own risk.

      Comment

      Working...
      X