home *** CD-ROM | disk | FTP | other *** search
/ Frostbyte's 1980s DOS Shareware Collection / floppyshareware.zip / floppyshareware / GLEN / DOSKEYSM.ZIP / DOSKEYS.DOC < prev   
Text File  |  1991-09-29  |  12KB  |  331 lines

  1.         DOSKEYS.BAT - MANAGING YOUR MACROS
  2.  
  3.  
  4.         I wrote this batch file for a friend who just got a PC and needed
  5.         a little help in using it.  However,  when it was finished,  I
  6.         thought that it would be helpful for any novice user.  In fact,
  7.         even if you're a pro,  it's still useful to provide a quick
  8.         reminder of what your macros are.   And most important,  it's
  9.         free.
  10.  
  11.         All you need to run it is MS-DOS 5.0.  You will also need the
  12.         external DOS programs MORE and DOSKEY somewhere in your path.
  13.         You should also have the ansi.sys (or a reasonable facsimile)
  14.         loaded.   DOSKEYS can run without it,  but it looks a lot nicer
  15.         with it.  If you used the DOS install program,  they're there.
  16.         Please note that some of the sample macros included in this file
  17.         refer to other DOS external programs.  Also,  the last 3 samples
  18.         are for commercial and shareware software.  They've been included
  19.         only as samples.
  20.  
  21.         DOSKEYS is very simple.  It invokes doskey with your macros and
  22.         maintains a help file to keep track of them.  The help file is
  23.         built whenever DOSKEYS loads your macros,  so as long as you
  24.         include the help line in DOSKEYS.BAT,  it will always be up-to-
  25.         date.  One of the macros included is ? which displays the help
  26.         file on your screen.  Another macro, MACROS calls DOSKEYS.BAT
  27.         into an editor (MS-DOS EDIT by default) so you can change it,
  28.         then reloads the macro definitions.
  29.  
  30.         To install DOSKEYS.BAT,  simply copy it to your disk.  It does
  31.         not NEED to be in the PATH,  but if it is not,  you must invoke
  32.         it with the full path name (not a relative path name).  For
  33.         example c:\etc\doskeys instead of etc\doskeys.  This is necessary
  34.         because some of the sample macros need to run DOSKEYS and the
  35.         only way they know where to find it is through the PATH or from
  36.         the command line.  Also,  if a full pathname is not used,  the
  37.         MACROS macro will work only if DOSKEYS.BAT is in the current
  38.         directory.
  39.  
  40.         To run DOSKEYS simply type its name at the DOS prompt.  For
  41.         example,  if you put DOSKEYS.BAT in your c:\ directory,  you
  42.         would type c:\doskeys.  You can run it automatically at boot time
  43.         by adding the following line to your autoexec.bat file:
  44.            call c:\doskeys
  45.         It is recommended that you use the full pathname,  but DO NOT
  46.         include the .bat extension.
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66.  
  67.  
  68.         DOSKEYS.BAT - MANAGING YOUR MACROS
  69.         CUSTOMIZING
  70.         DOSKEYS should run as is on most systems,  but there are a few
  71.         things that can be done to customize it.  The most obvious is
  72.         adding your own macros.  Refer to the next section for details on
  73.         adding macros.
  74.  
  75.         To customize DOSKEYS.BAT,  you'll have to edit it.   If you must
  76.         use a word processor such as WordPerfect or Wordstar,  make sure
  77.         you edit it in NON-DOCUMENT (ASCII) mode.   As an alternative,
  78.         use the EDIT command supplied with MS-DOS 5.0.
  79.  
  80.         Lines 2 through 6 of DOSKEYS.BAT contain a series of SET
  81.         commands.  These variables control the execution of DOSKEYS.
  82.         DO NOT remove these lines.  DOSKEYS will not run without them!
  83.  
  84.         The first one is CMD.  This tells DOSKEYS where to find the MS-
  85.         DOS command doskey.com.  If doskey.com is in your path,  you can
  86.         leave it as is.  Otherwise set this to the full pathname of the
  87.         doskey.com program.  example: set CMD=c:\dos\doskey
  88.  
  89.         Next is KTX.  This is the name and location of the file that
  90.         DOSKEYS will put help info into.   This can be any filename you
  91.         like.  The default is c:\doskeys.$$$.  NOTE: this must be a full
  92.         pathname.  If it is not,  you could end up with help files all
  93.         over your disk.   Anytime DOSKEYS cannot find the file,  it
  94.         creates it.
  95.  
  96.         BUFS.  This is the size of the doskey.com buffer. Refer to the
  97.         doskey documentation for more info.
  98.  
  99.         ANS  yes or no.  This tells DOSKEYS whether or not you are using
  100.         an ANSI console driver  (such as ANSI.SYS).  When set to yes
  101.         (lower case only),  DOSKEYS will use ANSI sequences to pretty up
  102.         the screen.  If you do not use an ANSI driver,  set this to any
  103.         value but "yes" (no would be a logical choice).  If your not
  104.         sure,  look in your CONFIG.SYS file for a line like:
  105.         DEVICE=C:\DOS\ANSI.SYS
  106.         Further,  if you see a bunch of [1;m junk when DOSKEYS displays
  107.         the help screen,  change this to no.
  108.  
  109.  
  110.  
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.         DOSKEYS.BAT - MANAGING YOUR MACROS
  135.         CUSTOMIZING
  136.         CRT  color or mono.  If you have a color screen (and ANS=yes),
  137.         DOSKEYS will use color to display the help screen.  If you want
  138.         colors and you have ANSI.SYS loaded,  set this to "color" (lower
  139.         case,  not quotes).  NOTE that a side effect of using ANSI
  140.         sequences is that DOSKEYS will change your default DOS color.
  141.         The default is the DOS default of grey on black.   Sorry,  but I
  142.         don't know of any way to detect the current color from a .BAT
  143.         file.   If you want to change this color,  locate the lines near
  144.         the end of DOSKEYS.BAT that read:
  145.                rem THE NEXT LINE WILL SET THE COLOR OF THE DOS PROMPT
  146.                if %CRT% == color echo ?[0;37;40m?[1A>>%KTX%
  147.                if NOT %CRT% == color echo ?[0m?[1A>>%KTX%
  148.         On the second line note the 0;37;40 .  The first number (0) is
  149.         the attribute.  The second (37) is the foreground color.  The
  150.         third (40) is the background color.  To change your default
  151.         color, modify this line with values from the following table:
  152.  
  153.         Attribute              Foreground        Background
  154.         0 normal               30 black          40 black
  155.         1 bright               31 red            41 red
  156.         4 underline            32 green          42 green
  157.         5 blink                33 yellow         43 yellow
  158.         7 reverse              34 blue           44 blue
  159.         8 invisible            35 magenta        45 magenta
  160.                                36 cyan           46 cyan
  161.                                37 white          47 white
  162.         The third line above does the same thing for mono systems,  in
  163.         which case,  only the attribute is changed.  For more
  164.         information,  refer to your MS-DOS documentation on ANSI.SYS.
  165.  
  166.         Finally,  I should point out that these variables are set and
  167.         unset within DOSKEYS so the only time they take up environment
  168.         space is when DOSKEYS is actually running.   Of course,  this
  169.         also means you cannot preset them.
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.         DOSKEYS.BAT - MANAGING YOUR MACROS
  201.         ADDING MACROS
  202.         All the macros defined in DOSKEYS begin on line 33,  right after
  203.         the line that looks like this  -
  204.         rem START OF DEFS *********************************************
  205.         To add new macros,  simply follow the examples.  There is also a
  206.         template on lines 28 and 29,  here it is
  207.         %CMD% MCR=
  208.                 echo MCR        DESCRIPTION>>%KTX%
  209.  
  210.         The first line is the actual macro.  The %CMD% is replaced at run
  211.         time by the doskey command.  It can also be replaced by the REM
  212.         command if DOSKEYS needs to build the help file without actually
  213.         loading the definitions (just in case it's accidentally deleted).
  214.         I suggest you refer to your MS-DOS manual for details on using
  215.         the doskey command.  However,  there are plenty of examples to
  216.         get you started.  Note that some of the definitions end with
  217.         %0 ?.  The %0 is replaced at run time by the the name of the bat
  218.         file (DOSKEYS).  This is why you should include the full path
  219.         name when DOSKEYS is first invoked.  If you typed DOSKEYS at the
  220.         command line %0 would expand to DOSKEYS.  Likewise,  if you typed
  221.         C:\DOSKEYS,  %0 would expand to C:\DOSKEYS.  In this way there is
  222.         never any question about where DOSKEYS is located.  It also
  223.         allows you to rename DOSKEYS.BAT.  By the way,  the ? tells
  224.         DOSKEYS to simply display the help screen.
  225.  
  226.         The second line is what builds the help file. the ECHO command
  227.         tells DOS to send whatever follows it to standard out (your
  228.         screen).   However,  the >>%KTX% tells DOS to append that output
  229.         to a file.  The %KTX% is expanded to whatever you called your
  230.         help file (by default c:\doskeys.$$$).   Make sure you use two
  231.         greater than (>) symbols or you will erase the previous contents
  232.         of the file.  Simple,  but effective.
  233.  
  234.         As you can see,  there is no direct relationship between the
  235.         macro and the help line.  You can have as many or as few help
  236.         lines as you want.  You could also include help lines for
  237.         commands that are not macros.  Experiment.
  238.         DOSKEYS has two primary functions:
  239.            1 - load doskey.com,  define macros,  and build the help file
  240.            2 - display the help file
  241.  
  242.         SYNTAX:
  243.           DOSKEYS
  244.              installs doskey,  macros, builds and displays the help file
  245.  
  246.           DOSKEYS install
  247.              installs doskey and macros,  builds but does not display
  248.              help  file
  249.  
  250.           DOSKEYS ?
  251.              displays the help file  (if the file is not found,  it
  252.              is recreated)  NOTE that this is the content of the
  253.              first sample macro "?".
  254.  
  255.           DOSKEYS ? home
  256.              same as DOSKEYS ?,  but also sets the current directory to
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.         DOSKEYS.BAT - MANAGING YOUR MACROS
  267.         USING DOSKEYS
  268.              C:\
  269.           DOSKEYS ? home p
  270.              same as DOSKEYS ? home,  but pauses before displaying help
  271.  
  272.         Please note that these paramaters are positional.  They must be
  273.         typed exactly as above and must be in the proper position,  that
  274.         is 1 for ? or install,  2 for home,  and 3 for p.  If you want to
  275.         use the second or third parm without the first use a placeholder.
  276.         For example: DOSKEYS ? x p  would pause and display the help, but
  277.         without changing the directory.
  278.  
  279.         Oh yes!  I should point out that line 13 will install doskey.com
  280.         if it has not already been installed.  If doskey has already been
  281.         installed,  it will beep and display a message stating that it's
  282.         already installed.  The >NUL sends that message into the void.  I
  283.         suspect that most people will load doskey in their config.sys
  284.         file,  but it's here just in case.
  285.  
  286.         Well,  that's it.   I can't believe I wrote so much about a bat
  287.         file.  Oh well.  If you need help with any of this,  feel free to
  288.         write. You can also leave E-mail on EXEC PC or COMPUSERVE.
  289.  
  290.                              Larry McElderry
  291.                              P.O.Box 1172
  292.                              Manhattan, KS 66502-0012
  293.                              Compuserve ID: 74017, 1630
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.  
  329.  
  330.  
  331.