home *** CD-ROM | disk | FTP | other *** search
/ Simtel MSDOS 1992 June / SIMTEL_0692.cdr / msdos / batutl / onboot.arc / ONBOOT.DOC next >
Text File  |  1988-08-03  |  10KB  |  218 lines

  1.                                   ONBOOT 1.00
  2.                                   -----------
  3.  
  4.         Purpose
  5.         -------
  6.         ONBOOT is a simple utility designed for your AUTOEXEC.BAT.  It
  7.         allows you to have AUTOEXEC run selected programs only during a
  8.         warm boot (Ctl-Alt-Del), a cold boot (power on), or the first
  9.         boot of the day.  For example, placing the command "ONBOOT DAILY
  10.         CHKDSK" into AUTOEXEC will cause AUTOEXEC to run CHKDSK only
  11.         once a day, the first time the PC is turned on.
  12.  
  13.         ONBOOT requires DOS 3.0 or later in DAILY mode, 2.0 or later in
  14.         WARM/COLD modes.
  15.  
  16.  
  17.         Use
  18.         ---
  19.         Using ONBOOT is quite simple.  The full command is:
  20.  
  21.             onboot WARM|COLD|DAILY command [parameters]
  22.  
  23.         The first parameter must be one of the three boot selectors,
  24.         "WARM", "COLD", or "DAILY":
  25.  
  26.             WARM    Execute the command only if this is a warm boot.  A
  27.                     warm boot is a "reboot", caused by pressing
  28.                     Ctl-Alt-Del or, on some machines, a reset switch.
  29.  
  30.             COLD    Execute the command only if this is a cold boot.  A
  31.                     cold boot is a power-up boot, resulting from turning
  32.                     the machine on.
  33.  
  34.             DAILY   Execute the command only if the system date has
  35.                     changed since the last time ONBOOT DAILY was run.
  36.  
  37.         "Command" can be any command that you would normally put into
  38.         AUTOEXEC.BAT (with minor restrictions as explained below), or it
  39.         can be another batch file.  It is specified exactly as you would
  40.         specify it if you were running it directly.  For example, a path
  41.         is required if the command to be executed is not in the current
  42.         directory or anywhere in the current PATH.  File extensions
  43.         (COM, EXE, BAT) are not required.
  44.  
  45.         Parameters to the command are also specified normally.
  46.  
  47.         Examples:
  48.  
  49.             onboot daily chkdsk
  50.             onboot cold ramtest full /count=3
  51.             onboot warm ramtest quick
  52.  
  53.  
  54.         Restrictions on commands
  55.         ------------------------
  56.         ONBOOT executes the requested command by giving it to a
  57.         secondary copy of the command shell (normally COMMAND.COM) for
  58.         processing.  Thus, anything you could normally execute at the
  59.         DOS prompt can be run by ONBOOT:  an internal DOS command, a
  60.         program or external DOS command (COM and EXE files), or a batch
  61.         file.  There are only two restrictions:
  62.  
  63.         1. Because the new copy of the command shell will drag along a
  64.         new copy of the environment, commands that set or modify
  65.         environment strings will not work as you expect.  Therefore,
  66.         don't use ONBOOT to execute SET, PATH, or PROMPT commands.
  67.  
  68.         2. Don't use ONBOOT to execute commands or batches that will
  69.         load resident programs (TSRs).  These include the obvious ones
  70.         like Sidekick, et al, as well as some DOS programs such as
  71.         PRINT, certain variants of MODE, etc.
  72.  
  73.         It is difficult to imagine why you would want to load TSRs or
  74.         set strings in the environment only on certain kinds of boots,
  75.         so these restrictions should not present any real problems.
  76.  
  77.  
  78.         Running multiple commands DAILY
  79.         -------------------------------
  80.         You can use as many ONBOOT WARM and ONBOOT COLD commands in
  81.         AUTOEXEC as you wish.  However, ONBOOT DAILY will only run once
  82.         a day, so having more than one ONBOOT DAILY command in AUTOEXEC
  83.         doesn't make sense; only the first one will ever get run.
  84.  
  85.         If you want to execute more than one command DAILY, put them in
  86.         a separate batch file and execute it DAILY from AUTOEXEC.  For
  87.         example:
  88.  
  89.             AUTOEXEC.BAT:
  90.                 ...
  91.                 onboot daily onceaday
  92.                 ...
  93.  
  94.             ONCEADAY.BAT:
  95.                 chkdsk
  96.                 ramtest massive
  97.                 otherstuff
  98.  
  99.         Each day, ONBOOT will run ONCEADAY.BAT, which will then run the
  100.         three commands shown.  When ONCEADAY.BAT is done, AUTOEXEC will
  101.         pick up again with the first command.
  102.  
  103.  
  104.         ONBOOT.EXE date stamp
  105.         ---------------------
  106.         ONBOOT determines how recently it was run by the simple
  107.         expedient of looking at its own date stamp.  Each time ONBOOT
  108.         DAILY is run successfully, ONBOOT updates the date stamp of the
  109.         program file, ONBOOT.EXE (this eliminates the need for a
  110.         separate data file to track dates).  If the date of ONBOOT.EXE
  111.         is different from the current system date, the DAILY stuff will
  112.         get executed.  If they are the same, DAILY has already run
  113.         today, and the command will not be executed.
  114.  
  115.         You don't really need to know this; it's just in case you ever
  116.         wondered why ONBOOT.EXE always appears to be brand new in your
  117.         directory displays.
  118.  
  119.  
  120.         Memory use
  121.         ----------
  122.         ONBOOT uses a bit under 2K of memory for itself.  The command
  123.         procesoor uses a bit more, typically under 4K for COMMAND.COM.
  124.         Thus, the commands run by ONBOOT will have about 6K less memory
  125.         to work with than normal.  ONBOOT is not resident, so it uses no
  126.         memory except when it is actually executed.
  127.  
  128.  
  129.         Error messages
  130.         --------------
  131.         Incorrect version of DOS
  132.             ONBOOT requires DOS 2.0 or later for WARM/COLD, and DOS 3.0
  133.             or later for DAILY.
  134.  
  135.         You must supply a command to be run
  136.             You didn't give ONBOOT a command to be executed.
  137.  
  138.         Can't find COMSPEC= in environment
  139.             Your environment must contain a COMSPEC statement to help
  140.             ONBOOT find the command processor.  DOS does this
  141.             automatically, so it will only be missing if you have taken
  142.             specific action to eliminate it, i.e., by executing a
  143.  
  144.                     SET COMSPEC=
  145.  
  146.             in AUTOEXEC before running ONBOOT.
  147.  
  148.         Problem executing command shell
  149.             ONBOOT wasn't able to give your command to the command
  150.             processor (COMMAND.COM) for execution.  Either the command
  151.             processor is missing (isn't where COMSPEC says it is) or
  152.             there isn't enough memory available.
  153.  
  154.         Error opening ONBOOT.EXE for date check
  155.             ONBOOT wasn't able to locate and open the program file
  156.             ONBOOT.EXE so that it could check its date.
  157.  
  158.         Unable to update timestamp on ONBOOT.EXE
  159.             ONBOOT wasn't able to change the date of ONBOOT.EXE to
  160.             today's date.  DAILY commands will continue to run with
  161.             every boot until you locate the source of the problem.
  162.  
  163.  
  164.         Version history
  165.         ---------------
  166.         1.00 08/03/88
  167.             Initial release.
  168.  
  169.  
  170.         Copyright/License/Warranty
  171.         --------------------------
  172.         This document and the program file ONBOOT.EXE ("the software")
  173.         are copyrighted by the author.  The copyright owner hereby
  174.         licenses you to:  use the software; make as many copies of the
  175.         program and documentation as you wish; give such copies to
  176.         anyone; and distribute the software and documentation via
  177.         electronic means.  There is no charge for any of the above.
  178.  
  179.         However, you are specifically prohibited from charging, or
  180.         requesting donations, for any such copies, however made; and
  181.         from distributing the software and/or documentation with
  182.         commercial products without prior permission.  An exception is
  183.         granted to not-for-profit user's groups, which are authorized to
  184.         charge a small fee (not to exceed $7) for materials, handling,
  185.         postage, and general overhead.  NO FOR-PROFIT ORGANIZATION IS
  186.         AUTHORIZED TO CHARGE ANY AMOUNT FOR DISTRIBUTION OF COPIES OF
  187.         THE SOFTWARE OR DOCUMENTATION, OR TO INCLUDE COPIES OF THE
  188.         SOFTWARE OR DOCUMENTATION WITH SALES OF THEIR OWN PRODUCTS.
  189.  
  190.         THIS INCLUDES A SPECIFIC PROHIBITION AGAINST FOR-PROFIT
  191.         ORGANIZATIONS DISTRIBUTING THE SOFTWARE, EITHER ALONE OR WITH
  192.         OTHER SOFTWARE, AND CHARGING A "HANDLING" OR "MATERIALS" FEE OR
  193.         ANY OTHER SUCH FEE FOR THE DISTRIBUTION.  NO FOR-PROFIT
  194.         ORGANIZATION IS AUTHORIZED TO INCLUDE THE SOFTWARE ON ANY MEDIA
  195.         FOR WHICH MONEY IS CHARGED.
  196.  
  197.         The software may not be included with distribution of commercial
  198.         or "shareware" software without a license from The Cove Software
  199.         Group.
  200.  
  201.         No copy of the software may be distributed or given away without
  202.         this document; and this notice must not be removed.
  203.  
  204.         There is no warranty of any kind, and the copyright owner is not
  205.         liable for damages of any kind.  By using this free software,
  206.         you agree to this.
  207.  
  208.         The software and documentation are:
  209.  
  210.                              Copyright (C) 1988 by
  211.                             The Cove Software Group
  212.                              Christopher J. Dunford
  213.                                  P.O. Box 1072
  214.                             Columbia, Maryland 21044
  215.  
  216.                                  (301) 992-9371
  217.                          CompuServe 76703,2002 [IBMNET]
  218.