home *** CD-ROM | disk | FTP | other *** search
/ Cheet Sheets 1995 February / CHEET38.ZIP / INSTALL.DAT / 1OPTIP38.TXT < prev    next >
Text File  |  1995-02-07  |  3KB  |  106 lines

  1. ~Today's Top DOS Tip
  2.  
  3. By Simon Burrows
  4.  
  5.  
  6. ~`Intro:
  7. ~`-----
  8.  
  9. `This month  sees a more advanced Top Tip than usual.  It will allow
  10. `you to  define the  meanings to  the F-Keys to save typing the full
  11. `names of  frequently-used commands.   For example, you could define
  12. `the F10 key to the DIR command, so that every time you press F10 in
  13. `DOS, it gives you a directory listing of the present directory.
  14.  
  15.  
  16. ~`Method:
  17. ~`------
  18.  
  19. `This tip  requires the  use of  ANSI.SYS.  To use this, you need to
  20. `add a  line in  your CONFIG.SYS  file as  follows :-    (You  could
  21. `replace 'Device=' with 'Devicehigh=' to load it into high-memory)
  22.  
  23. `DEVICE=C:\DOS\ANSI.SYS      (The path C:\DOS may differ on your PC)
  24.  
  25. `When this  is loaded you can then add lines to your AUTOEXEC.BAT to
  26. `define the F-Keys to the tasks you desire.  The best way to explain
  27. `how to do this is to give an example :-
  28.  
  29.  
  30. ~`ECHO 8;"DIR";13p
  31. ~`     │    │    │    │
  32. ~`    *1   *2   *3   *4
  33. ~`     │    │    │    │
  34. ~`     │    │    │   This "13p" enters the command that  you have
  35. ~`     │    │    │   put at *3.
  36. ~`     │    │    │
  37. ~`     │    │   This part in " "s specifies what command the key-
  38. ~`     │    │   press will do.
  39. ~`     │    │
  40. ~`     │   This "0;68" specifies which key you  press to  run the
  41. ~`     │   command.
  42. ~`     │
  43. ~`    This "" is called an 'ESC character'.
  44.  
  45.  
  46. `This example  will do a list of the present directory each time you
  47. `press F10.
  48.  
  49.  
  50. `*1) This  character is  created  in  different  ways  in  different
  51. `    programs.   The most commonly-used program to edit AUTOEXEC.BAT
  52. `    is MS-DOS  Edit.   In MS-DOS  Edit, you  first press  ALT+P (to
  53. `    generate a  ^P appear  at the  bottom of  the screen), then you
  54. `    press the [ESC] key where you want the '' character to appear.
  55.  
  56. `*2) If  you want to change the task the F-Key does  (eg, instead of
  57. `    doing a  directory listing,  clearing the  screen)  you need to
  58. `    change the section in " "s to the new command.
  59.  
  60. `*3) If  you want  to change  which F-key you have to press to carry
  61. `    out the  command, you  have to  change the  0;68 after the open
  62. `    square bracket to a different ASCII code.  Here's a list of all
  63. `    the F-key ASCII codes :-
  64.  
  65. `                     F1 - 0;59     F6  - 0;64
  66. `                     F2 - 0;60     F7  - 0;65
  67. `                     F3 - 0;61     F8  - 0;66
  68. `                     F4 - 0;62     F9  - 0;67                     
  69. `                     F5 - 0;63     F10 - 0;68
  70.  
  71. ~`NOTE:  F1 &  F3 are  both used  in DOS  to  repeat  the  characters
  72. ~`       typed at  the last  prompt.  If you want these facilities to
  73. ~`       stay, you musn't assign a command over the top of them.
  74.  
  75. `*4) If you don't  have this  part in  the line, the F-Key will  put
  76. `    your command  at the  prompt, but  not 'press' [ENTER] after it
  77. `    for you.
  78.  
  79.  
  80. ~`Example:
  81. ~`-------
  82.  
  83. ECHO 2;"CLS";13p
  84.  
  85. This will run  the CLS command (to clear the screen) every time the 
  86. F4 key is pressed.
  87.  
  88.  
  89. ~`Advanced Use:
  90. ~`------------
  91.  
  92. It is also possible for an F-Key to carry out two commands. All you
  93. need is  a linefeed  code   (linefeed code  is 10)  between the two
  94. commands.
  95.  
  96. For example,  if you  wanted F5 to enter the \GAMES\POOL directory,
  97. then run  the file  POOL.EXE, then  you  would  use  the  following
  98. command line :-
  99.  
  100. ECHO 3;"CD\GAMES\POOL";13;10;"POOL";13p
  101.  
  102.  
  103. ~Until the next time, folks....
  104.  
  105. ~Simon Burrows
  106.