Index | Syntax | Notes  



PROMPT--Examples

The following example sets the command prompt to display the current drive and path followed by the greater-than sign (>): prompt $p$g The following command displays a two-line prompt in which the current time appears on the first line and the current date appears on the second line: prompt time is: $t$_date is: $d If your CONFIG.SYS file loads ANSI.SYS, you can use ANSI escape sequences in your prompts. The following command, for example, displays your prompt in reverse video mode and returns to usual video mode for other text: prompt $e[7m$n:$e[m The characters following the escape code ($E) are ANSI escape sequences. Batch example (tested in Win98): @%comspec%/c For %%v in (1 2) do Prompt Current drive is $n$_|Find/v "_" Displaying pipes Whilst I was playing around trying to display a pipe using the echo command - my colleagues and I stumbled upon using the carrot ^ which allows this to be done. e.g. echo ^| Cheers James p.s. using Win2K, so i don't know if this will make a difference.. It does make a difference. PROMPT can be used instead of the ECHO command to display a pipe or other characters. Below are six lines, which can be used to write some pipes: :: using the character of ASCII value 255 (FFh) to write a left margin: echo exit|%comspec%/kprompt ÿ $b$_|find "ÿ" :: using the character of ASCII value 255: echo exit|%comspec%/kprompt $bÿ$_|find "ÿ" :: or a space: echo exit|%comspec%/kprompt $b $_|find " " :: using the E in EXIT. (the pipe would be prefixed with a blank line:) echo Exit|%comspec%/kprompt $b$_|FIND "e"/V/I :: or using a not case sensitive character: echo exit|%comspec%/kprompt $b$_:|find ":"/v echo exit:|%comspec%/kprompt $b$_|find ":"/v
-Top- | Syntax | Notes