home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cheet Sheets 1995 June
/
cheet41.zip
/
1OPTIP41.TXT
< prev
next >
Wrap
Text File
|
1995-09-26
|
5KB
|
166 lines
~Today's Top DOS Tip
Customising your DOS desktop with the prompt command
~By -SIMON BURROWS-
~`Introduction
~`────────────
`Right, first of all let me get one thing straight: this is hard
`core prompting we're talking here! If you're looking for some
`simple text message in 2 shades of grey (or black and white to be
`more precise), and not even a sniff of ANSI escape sequences or
`the glorious 7 colours ANSI allows you to utilise in DOS, then get
`out....go on....get out........(and don't come back!)
Still here, eh?
`Seriously though, folks, this is pretty complicated stuff for your
`average DOS user, and I'm not about to go and explain how each and
`every part of the line works to a beginner's level. The example I
`shall be giving you below uses three types of commands: ANSI
`directional sequences (for moving the cursor around the screen);
`ANSI colour sequences (for changing the background and foreground
`colours of text on the DOS display); and prompt ('$') commands to
`make DOS display different information on your prompt.
`For more information about the prompt command type "HELP PROMPT"
`when you've finished reading this great magazine. Alternatively,
`you could check out the basic pointers in the 'Prompt' section of
`my "Write your own AUTOEXEC.BAT" found in issue 40 of Cheet
`Sheets. For more information about ANSI sequences, type "HELP
`ANSI.SYS" at your DOS prompt, and more information can be found in
`my "Top DOS Tip" in Issue 38 of Cheet Sheets.
~`But first this
~`──────────────
`Since the prompt I shall be going through uses ANSI escape
`sequences, ANSI.SYS will have to be loaded before your computer's
`gonna' understand what the heck you're going on about.
`ANSI.SYS is loaded in your CONFIG.SYS file by inserting the
`following line :-
DEVICE=C:\DOS\ANSI.SYS
~`Getting Started
~`───────────────
`Now we can get down to prompt designing.
`Your computer, as you'll probably know, is usually told how your
`prompt will look with the PROMPT command in your AUTOEXEC.BAT.
`Load your AUTOEXEC.BAT into MS-DOS Edit (or some similar text
`editor) and look for a line starting "PROMPT...". This will
`often read "PROMPT $p$g". Once the line has been located, start
`inserting your new commands from here (after first deleting all
`the characters on that line other than the initial "PROMPT"
`statement).
~`Method
~`──────
`Here is the line which you will need to insert :-
~`PROMPT $e[s$e[1H$e[37;41;1m $e[37;44;1m
`└────┘ └──┘└───┘└─────────┘ └───────┘ └─────────┘ (Although I
` │ │ │ │ │ │ go onto a
`primary │ goto │ insert your changes new line
`command │line 1 │ message here background here, you
` │ │ (39 chars.) colour to shouldn't)
`save cursor change back blue
` position ground to red
~`It's $t on $d $e[37;40;0m$e[u$e[23B$p$g
`└──────────────┘ └─────────┘└──┘└────┘└──┘
` │ │ │ │ │
`Displays "It's", changes │ moves displays
`then the current background │ down current
`time, then "on", colour restores 23 drive and
`then the current back to cursor to directory
`date (inc. day) black position bottom then a '>'
~`Results
~`───────
`This command in your AUTOEXEC.BAT will give you a 2-colour banner
`at the top of your screen throughout your DOS session. The first
`half of the banner (from the centre of the screen leftwards) will
`give your personalised message. This must be 39 characters or
`less - the nearer to 39 it is, the better it will look on the
`screen. The background colour of this will be red. The second
`half of the banner (going from the centre of the screen to the
`far right) will have a blue background colour and will inform the
`user of the current time and date.
`BE WARNED: The time and date will only be refreshed each time you
` get a new prompt, in other words, each time you press
` [ENTER] on your PC. If, therefore, you leave your PC
` without any interaction for a while, your boss, or
` some other unsavoury character who happens to be
` walking past your monitor at an inopportune moment,
` will see that the last time you actually did some work
` was half an hour ago!!!!
~`Example
~`───────
`Here's an example. (Note that although I've had to show you this
`example on two lines, it should all follow through on one line in
`your AUTOEXEC.BAT) :-
`PROMPT $e[s$e[1H$e[37;41;1m Unless you're name's Simon, GO AWAY!!
`$e[37;44;1m It's $t on $d $e[37;40;0m$e[u$e[23B$p$g
`This makes your desktop look just great!!
~Bon Appetit...
` ───────────────
~` Simon Burrows
` ───────────────
This Article Copyright (c) 1995 Eurowave Leisure Ltd.