home *** CD-ROM | disk | FTP | other *** search
/ Cheet Sheets 1995 June / cheet41.zip / 1OPTIP41.TXT < prev    next >
Text File  |  1995-09-26  |  5KB  |  166 lines

  1. ~Today's Top DOS Tip
  2.  
  3.  
  4.  
  5. Customising your DOS desktop with the prompt command
  6.  
  7. ~By  -SIMON BURROWS-
  8.  
  9.  
  10.  
  11.  
  12. ~`Introduction
  13. ~`────────────
  14.  
  15.  
  16. `Right, first  of all  let me  get one thing straight: this is hard
  17. `core prompting  we're talking  here!   If you're  looking for some
  18. `simple text message in 2 shades of grey  (or black and white to be
  19. `more precise),  and not  even a  sniff of ANSI escape sequences or
  20. `the glorious 7 colours ANSI allows you to utilise in DOS, then get
  21. `out....go on....get out........(and don't come back!)
  22.  
  23.  
  24. Still here, eh?
  25.  
  26.  
  27. `Seriously though, folks, this is pretty complicated stuff for your
  28. `average DOS user, and I'm not about to go and explain how each and
  29. `every part of the line works to a beginner's level.  The example I
  30. `shall be  giving you  below uses  three types  of  commands:  ANSI
  31. `directional sequences  (for moving  the cursor around the screen);
  32. `ANSI colour sequences  (for changing the background and foreground
  33. `colours of  text on the DOS display); and prompt ('$') commands to
  34. `make DOS display different information on your prompt.
  35.  
  36. `For more  information about  the prompt command type "HELP PROMPT"
  37. `when you've  finished reading this great magazine.  Alternatively,
  38. `you could  check out the basic pointers in the 'Prompt' section of
  39. `my "Write  your own  AUTOEXEC.BAT" found  in  issue  40  of  Cheet
  40. `Sheets.   For more  information about  ANSI sequences,  type "HELP
  41. `ANSI.SYS" at your DOS prompt, and more information can be found in
  42. `my "Top DOS Tip" in Issue 38 of Cheet Sheets.
  43.  
  44.  
  45.  
  46.  
  47. ~`But first this
  48. ~`──────────────
  49.  
  50.  
  51. `Since the  prompt I  shall  be  going  through  uses  ANSI  escape
  52. `sequences, ANSI.SYS  will have to be loaded before your computer's
  53. `gonna' understand what the heck you're going on about.
  54.  
  55. `ANSI.SYS is  loaded in  your  CONFIG.SYS  file  by  inserting  the
  56. `following line :-
  57.  
  58.  
  59. DEVICE=C:\DOS\ANSI.SYS
  60.  
  61.  
  62.  
  63.  
  64. ~`Getting Started
  65. ~`───────────────
  66.  
  67.  
  68. `Now we can get down to prompt designing.
  69.  
  70. `Your computer,  as you'll  probably know, is usually told how your
  71. `prompt will  look with  the PROMPT  command in  your AUTOEXEC.BAT.
  72. `Load your  AUTOEXEC.BAT into  MS-DOS Edit   (or  some similar text
  73. `editor)   and look  for a  line starting  "PROMPT...".   This will
  74. `often read  "PROMPT $p$g".   Once the line has been located, start
  75. `inserting your  new commands  from here  (after first deleting all
  76. `the characters  on that  line  other  than  the  initial  "PROMPT"
  77. `statement).
  78.  
  79.  
  80.  
  81.  
  82. ~`Method
  83. ~`──────
  84.  
  85.  
  86. `Here is the line which you will need to insert :-
  87.  
  88.  
  89. ~`PROMPT $e[s$e[1H$e[37;41;1m            $e[37;44;1m     
  90. `└────┘ └──┘└───┘└─────────┘ └───────┘  └─────────┘      (Although I
  91. `   │     │   │       │          │           │           go onto a 
  92. `primary  │ goto      │   insert your   changes          new line
  93. `command  │line 1     │  message here   background       here, you
  94. `         │           │   (39 chars.)   colour to        shouldn't)
  95. `save cursor     change back            blue
  96. `   position   ground to red
  97.  
  98.  
  99. ~`It's  $t  on  $d $e[37;40;0m$e[u$e[23B$p$g
  100. `└──────────────┘ └─────────┘└──┘└────┘└──┘
  101. `       │               │      │    │    │
  102. `Displays "It's",  changes     │  moves  displays
  103. `then the current  background  │   down   current
  104. `time, then "on",  colour  restores  23    drive and
  105. `then the current  back to   cursor  to     directory
  106. `date  (inc. day)  black   position  bottom  then a '>'
  107.  
  108.  
  109.  
  110.  
  111. ~`Results
  112. ~`───────
  113.  
  114.  
  115. `This command  in your AUTOEXEC.BAT will give you a 2-colour banner
  116. `at the  top of your screen throughout your DOS session.  The first
  117. `half of the banner  (from the centre of the screen leftwards) will
  118. `give your  personalised message.   This  must be  39 characters or
  119. `less -  the nearer  to 39  it is,  the better  it will look on the
  120. `screen.   The background  colour of  this will be red.  The second
  121. `half of  the banner   (going  from the centre of the screen to the
  122. `far right)  will have a blue background colour and will inform the
  123. `user of the current time and date.
  124.  
  125.  
  126. `BE WARNED:  The time and date will only be refreshed each time you
  127. `            get a  new prompt, in other words, each time you press
  128. `            [ENTER] on  your PC.  If, therefore, you leave your PC
  129. `            without any  interaction for  a while,  your boss,  or
  130. `            some other  unsavoury  character  who  happens  to  be
  131. `            walking past  your monitor  at an  inopportune moment,
  132. `            will see that the last time you actually did some work
  133. `            was half an hour ago!!!!
  134.  
  135.  
  136.  
  137. ~`Example
  138. ~`───────
  139.  
  140.  
  141. `Here's an  example.  (Note that although I've had to show you this
  142. `example on  two lines, it should all follow through on one line in
  143. `your AUTOEXEC.BAT) :-
  144.  
  145.  
  146. `PROMPT $e[s$e[1H$e[37;41;1m  Unless you're name's Simon, GO AWAY!!
  147. `$e[37;44;1m It's  $t  on  $d $e[37;40;0m$e[u$e[23B$p$g
  148.  
  149.  
  150. `This makes your desktop look just great!!
  151.  
  152.  
  153.  
  154.  
  155.  
  156. ~Bon Appetit...
  157.  
  158.  
  159. `                           ───────────────
  160. ~`                            Simon Burrows
  161. `                           ───────────────
  162.  
  163.  
  164. This Article Copyright (c) 1995 Eurowave Leisure Ltd.
  165.  
  166.