home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / a / atbat100.zip / ATBAT.DOC next >
Text File  |  1993-01-20  |  60KB  |  1,585 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.        
  7.        
  8.        
  9.                               ATBAT (tm)  Ver. 1.00
  10.                            Copyright (C) 1993 SOFTWEST
  11.                                All Rights Reserved.
  12.        
  13.                               _______
  14.                          ____|__     |               (tm)
  15.                       --|       |    |-------------------
  16.                         |   ____|__  |  Association of
  17.                         |  |       |_|  Shareware
  18.                         |__|   o   |    Professionals
  19.                       -----|   |   |---------------------
  20.                            |___|___|    MEMBER
  21.        
  22.        
  23.                           5120 Campbell Ave. Suite 216
  24.                                San Jose, CA 95130
  25.                                  (408) 370-7095
  26.                                  (408) 370-7096 (FAX)
  27.                                  CIS: 70205,533 (Tom Crosley)
  28.  
  29.  
  30.        ATBAT is a utility for AuTomatically creating and executing BATch
  31.        files which consist of a list of files, each associated with the
  32.        same DOS command or other text.  The files may be optionally
  33.        selected via some criteria such as size, age, attributes, or
  34.        contents.  ATBAT can also be used for many other purposes, such
  35.        as automatically creating "make" files used by programmers, and
  36.        to generate custom directory listings. 
  37.  
  38.  
  39.        Packing List
  40.        ------------
  41.  
  42.        The complete ATBAT 1.0 evaluation package (typically compressed
  43.        into a .ZIP or self-extracting .EXE file) should contain the
  44.        following files.  Please be sure that each file is present.  If
  45.        any of these files are missing then the package is not complete
  46.        and is not suitable for distribution to others. 
  47.  
  48.            File Name:                Purpose of File:
  49.            ------------   -----------------------------------------
  50.        
  51.            ATBAT.DOC      This text file.  User manual, warranty
  52.                           disclaimer, plus information on registering
  53.                           your copy of ATBAT.
  54.        
  55.            ATBAT.EXE      The executable program for IBM PC/XT/AT/PS2
  56.                           and 100% compatible computers running
  57.                           MS-DOS/PC-DOS 2.10 or later with a minimum
  58.                           of 256K RAM (and any compatible display).
  59.        
  60.            FILE_ID.DIZ    Standard file description ("Description In
  61.                           Zip"), for Bulletin Board Systems (BBS)
  62.                           and disk vendors.
  63.  
  64.                                       -1-
  65.  
  66.  
  67.  
  68.  
  69.  
  70.  
  71.        
  72.            ORDER.DOC      Self-contained order form/mailer
  73.        
  74.            SYSOP.DOC      Information for BBS distribution.
  75.        
  76.            VENDOR.DOC     Information and restrictions for disk vendors,
  77.                           distributors, user groups, and more.
  78.  
  79.        Disclaimer of Warranty
  80.        ----------------------
  81.  
  82.             Users of ATBAT must accept this disclaimer of warranty: 
  83.  
  84.           "ATBAT 1.0 is supplied as is.  SOFTWEST disclaims all
  85.            warranties, expressed or implied, including, without
  86.            limitation, any warranties of merchantability or fitness
  87.            for any purpose. 
  88.  
  89.                 SOFTWEST does not assume any liability for the use
  90.            of this software beyond the original purchase price of
  91.            this software. 
  92.  
  93.                 Improper use of this software can be hazardous,
  94.            since it is possible to create a batch file which will
  95.            delete or modify a large number of files at once, up to
  96.            and including all the files on your computer. 
  97.  
  98.                 In no event will SOFTWEST be liable to you for any
  99.            additional damages, including any lost profits, lost
  100.            savings or other incidental or consequential damages
  101.            arising from the use of, or inability to use, this
  102.            software, even if SOFTWEST has been advised of the
  103.            possibility of such damages."
  104.  
  105.             This program is produced by a member of the Association of
  106.        Shareware Professionals (ASP).  ASP wants to make sure that the
  107.        shareware principle works for you.  If you are unable to resolve
  108.        a shareware-related problem with an ASP member by contacting the
  109.        member directly, ASP may be able to help.  The ASP Ombudsman can
  110.        help you resolve a dispute or problem with an ASP member, but
  111.        does not provide technical support for members' products.  Please
  112.        write to the ASP Ombudsman at 545 Grover Road, Muskegon, MI 49442
  113.        or send a CompuServe message via CompuServe Mail to ASP
  114.        Ombudsman, 70007,3536. 
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.                                       -2-
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.        Overview
  138.        ========
  139.  
  140.        For a summary of program usage and options, simply run ATBAT with
  141.        nothing else typed after the command. 
  142.  
  143.             ATBAT's primary purpose is to create and execute batch files
  144.        (files ending in a .BAT extension) which consist of the same
  145.        command operating over and over on a list of files.  If you are
  146.        unfamiliar with batch files, they are described in your DOS
  147.        manual and in most books that discuss using DOS on IBM-compatible
  148.        PC's. 
  149.  
  150.             ATBAT has been primarily tested under MS-DOS 5.0 and 3.3
  151.        (both with and without NDOS, a command line interpreter
  152.        replacement from Norton Utilities based on the shareware product
  153.        4DOS).  ATBAT should work with any version of DOS 2.1 or later,
  154.        including MS-DOS, PC-DOS, and DR-DOS. 
  155.  
  156.             There is no installation per se; just copy ATBAT.EXE to a
  157.        subdirectory such as \BIN or \UTIL which is included in the PATH
  158.        statement of your AUTOEXEC.BAT FILE. 
  159.  
  160.             As an example of when to use ATBAT, let's say you're running
  161.        low on free space on your hard disk, and decide you want to clear
  162.        out all your ".BAK" files.  If you have a large hard disk with
  163.        many subdirectories, this is not an easy task to accomplish using
  164.        just ordinary DOS commands since the MS-DOS DEL command cannot
  165.        traverse subdirectories.  (DEL commands in other command line
  166.        interpreters such as 4DOS can, but they don't have the additional
  167.        file selection capabilities described below that ATBAT does). 
  168.  
  169.             If you have a disk manager such as Xtree Gold you could fire
  170.        it up, but that takes time to log all the directories and you
  171.        still have to tag just the *.BAK files, and then delete them.  If
  172.        you decide you want to do this every week or so, you can't write
  173.        a batch file to do the task. 
  174.  
  175.             If you have MS-DOS 5.0 or a similar version, you can create
  176.        a list of all the .BAK files using the command: 
  177.  
  178.                DIR /B /S *.BAK > TEMP.BAT
  179.  
  180.        but then you would have to go into a text editor and add "DEL" in
  181.        front of each line before executing TEMP.  If you're like me,
  182.        you've probably done something like this at sometime or another.
  183.        Again, not something you can automate very easy. 
  184.  
  185.             With ATBAT, this is all much simpler.  You can type the
  186.        command: 
  187.  
  188.                ATBAT "DEL #P" /S *.BAK > TEMP.BAT
  189.  
  190.        and ATBAT will search all the subdirectories (/S) at or below the
  191.        current one for files with a .BAK extension, and then create a
  192.        file TEMP.BAT with "DEL" in front of each pathname. 
  193.  
  194.  
  195.  
  196.                                       -3-
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.             The first parameter (DEL #P) is a "template" for creating
  204.        the list of commands to be executed.  If a template contains any
  205.        spaces, it must be surrounded by double quotes as shown above.
  206.        In this case, #P represents the substituted pathname for each
  207.        matching file.  There are many other "#" substitutions to choose
  208.        from. 
  209.  
  210.             Since deleting files is such a common task, you can use #Z
  211.        (Zap files) instead of "DEL #P".  And since creating, executing,
  212.        and then deleting a temporary batch file is also a common
  213.        operation, there is a single command line option (/X) for this,
  214.        too.  (Another advantage of using the /X option, rather than
  215.        redirecting to a file, is you get to see the files that are going
  216.        to be deleted.)
  217.  
  218.             So the command to delete all your .BAK files becomes just: 
  219.  
  220.                ATBAT #Z /S \*.BAK /X
  221.  
  222.        I have added a \ in front of the file specification (referred to
  223.        as file spec from here on) to force ATBAT to start its search
  224.        from the top level directory.  That way, the command works from
  225.        anywhere, not just from the root. 
  226.  
  227.             There are also command line options to select files based on
  228.        their attributes, or their date or their size, and whether they
  229.        contain (or don't contain) a matching text string.  All of these
  230.        selection switches can operate together, so it is a simple
  231.        matter, for example, to say "I want to delete all my .BAK files
  232.        more than 10K bytes long and over 1 week old": 
  233.  
  234.                ATBAT #Z /S /K10 /D7 \*.BAK /X
  235.  
  236.        If you want, you can stick this in your AUTOEXEC.BAT file and
  237.        clean up old .BAK files every time you start your computer.  (For
  238.        such cases, there are additional switches for suppressing the
  239.        normal "in progress" messages, and for eliminating the default
  240.        confirmation before executing the generated batch file.)
  241.  
  242.             Have more than one hard disk volume?  No problem, you can
  243.        list as many file specs as you want: 
  244.  
  245.                ATBAT #Z /S /K10 /D7 C:\*.BAK D:\*.BAK G:\*.BAK /X
  246.  
  247.        I have been showing the /X option at the end, and the others
  248.        before the file specifications since that's the order in which
  249.        they will be executed, but the order doesn't make any
  250.        difference.  The only requirement is that the template (#Z in
  251.        this case) must be before any of the file specs. 
  252.  
  253.             In addition, options can be preceded by either '/' or '-',
  254.        and be typed in upper or lower case (the case of the option
  255.        determines the case of the substituted filenames).  So the above
  256.        command could just as well have been written as: 
  257.  
  258.  
  259.  
  260.  
  261.  
  262.                                       -4-
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.                atbat -x -d7 -k10 -s #z c:\*.bak d:\*.bak g:\*.bak
  270.  
  271.        I'll continue to use uppercase in my examples though, just to
  272.        make them stand out better. 
  273.  
  274.             That's it for the basics.  There's many more examples below,
  275.        where I cover each of the template substitutions and option
  276.        switches, one by one.  Each of these are also summarized in a
  277.        couple of on-line help screens, which come up if you just type
  278.        ATBAT by itself. 
  279.  
  280.  
  281.        Templates
  282.        =========
  283.  
  284.        The template is the pattern of what the output is going to look
  285.        like -- whether it is going to a file, or just displaying on a
  286.        screen.  If you are creating a batch file which will be executed,
  287.        you must explicitly include a DOS-executable command at the
  288.        beginning of your template.  (There are also lots of applications
  289.        for ATBAT where you don't need to include a DOS command, such as
  290.        creating custom directory listings.)
  291.  
  292.             Except for possible option switches which can go most
  293.        anywhere, the template must be the first thing after the ATBAT
  294.        command itself.  A DOS command line is broken up into
  295.        "parameters", and ATBAT considers the first parameter which
  296.        doesn't start with a '-' or '/' character (the lead-in characters
  297.        for options) to be the template.  All non-option parameters after
  298.        the first one are considered to be file specifications. 
  299.  
  300.             Since almost all DOS commands need a space between the
  301.        command itself and their first parameter, typically you need to
  302.        include a space after the command in your template too.  However
  303.        this causes DOS to break the template into two parameters before
  304.        giving it off to ATBAT, and ATBAT won't see the template as you
  305.        intended (it will treat the second half as the first file spec).
  306.        The way around this is to always enclose the template in double
  307.        quotes if it contains any embedded spaces: 
  308.  
  309.                atbat "DEL #P" /s *.bak > temp.bat      <--- do this
  310.        
  311.                atbat  DEL #P  /s *.bak > temp.bat      <--- NOT THIS!
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.  
  328.                                       -5-
  329.  
  330.  
  331.  
  332.  
  333.  
  334.  
  335.        Template Substitutions
  336.        ======================
  337.  
  338.        Much of the flexibility of ATBAT comes from the large number of
  339.        substitutions that can be carried out in the template.  I'll
  340.        cover them in logical groups now; they're listed in alphabetical
  341.        order in the help screens. 
  342.  
  343.  
  344.        File name substitutions:
  345.        ------------------------
  346.  
  347.        #P = full Path and name of file
  348.        #: = drive letter (without the :)
  349.        #R = paRtial path
  350.        #N = fileName
  351.        #E = Extension (without the .)
  352.        #F = Filename and extension (similar to #N.#E)
  353.  
  354.        You will probably use the file name substitutions more than any
  355.        others, since a typical use of ATBAT is to generate a batch file
  356.        which operates on a group of files that you have selected.  The
  357.        most general filename substitution is the full pathname (#P),
  358.        such as C:\DOS\HIMEM.SYS
  359.  
  360.             You can also reference each individual part of the full path
  361.        by itself however, so for the previous example, the separate
  362.        components would be: 
  363.  
  364.                #P - full pathname, such as C:\DOS\HIMEM.SYS
  365.        
  366.                #: = drive letter (no :)   =>   C
  367.                #R = paRtial path          =>   \DOS
  368.                #N = fileName              =>   HIMEM
  369.                #E = Extension (no .)      =>   SYS
  370.  
  371.        The individual components are stripped of their usual punctuation
  372.        (the :  after the drive letter, the final \ in the partial path,
  373.        and the . before the extension) to allow you to do most anything
  374.        you want with them. 
  375.  
  376.             The combination #N.#E comes up so often ATBAT includes a
  377.        special shorthand substitution #F just for this.  There is a
  378.        subtle difference though; if a filename doesn't have an
  379.        extension, #F will not have a trailing period, but #N.#E will
  380.        (which can be useful sometimes).  So the full path template #P
  381.        can also be written out as: 
  382.  
  383.                #::#R\#F
  384.  
  385.        Note the two colons in this example; the first one is part of the
  386.        drive letter substitution #:, and the second one puts a : after
  387.        the drive letter. 
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.                                       -6-
  395.  
  396.  
  397.  
  398.  
  399.  
  400.  
  401.             You can use either upper or lower case in the filename
  402.        substitutions.  The output will be the same case as the that of
  403.        the template substitution letter.  So #P will cause all paths to
  404.        be upper case, and #p will output them in lower case.  Likewise
  405.        for the others:  #E/#e, #F/#f, #N/#n, #R/#r.  The drive letter
  406.        substitution #: is always uppercase; there is a lowercase version
  407.        available by typing #;
  408.  
  409.  
  410.        File attribute substitutions:
  411.        -----------------------------
  412.  
  413.        #S = file Size in bytes
  414.        #K = file size in Kbytes
  415.        #D = Date, as mm-dd-yy (or dd-mm-yy or yy-mm-dd)
  416.        #T = Time, as hh:mm(a/p)
  417.        #A = file Attributes, RHSA/D:
  418.                Read-only/Hidden/System/Archive/Directory
  419.  
  420.        The file attribute substitutions are most often used when you
  421.        want to create some type of customized directory listing. 
  422.  
  423.  
  424.             The #S substitution lists the size of the file in bytes, the
  425.        same as reported by the DIR command.  It is a decimal number
  426.        right-justified in a nine-digit field, to allow for individual
  427.        files up to 999,999,999 bytes (!).  Be sure to allow for all nine
  428.        character positions when planning output formats. 
  429.  
  430.             The #K substitution also lists the size of the file, but in
  431.        kilobytes instead of bytes.  (1024 bytes = one kilobyte.) The #K
  432.        file size is a decimal number right-justified in a six-digit
  433.        field, to allow for individual files up to 999,999 Kbytes.  As
  434.        before, be sure to allow for six character positions in your
  435.        output. 
  436.  
  437.             There is no difference between #S and #s, or #K and #k since
  438.        neither generates any alphabetic characters. 
  439.  
  440.  
  441.             The #D substitution gives the date the last time the file
  442.        was modified (or created, if it has not been modified).  The
  443.        format for the #D output is usually dependent on the COUNTRY=
  444.        line in your CONFIG.SYS file; e.g. the line
  445.  
  446.                COUNTRY=044,,C:\DOS\COUNTRY.SYS
  447.  
  448.        selects the United Kingdom, which uses the European date format
  449.        (dd-mm-yy).  If there is no country selection, the program
  450.        defaults to United States convention, which is mm-dd-yy.  The
  451.        third format, yy-mm-dd, is used in Japan. 
  452.  
  453.             You can tell which format is going to be used, since the
  454.        Help screens for the #D and /D options also change accordingly.
  455.        It is also possible to change the date format using a option
  456.        switch (/DF), which is explained further on in the section on
  457.        options. 
  458.  
  459.  
  460.                                       -7-
  461.  
  462.  
  463.  
  464.  
  465.  
  466.  
  467.             There is no difference between #D and #d, since neither
  468.        generates any alphabetic characters. 
  469.  
  470.  
  471.             The #T substitution gives the time when the file was last
  472.        modified (or initially created, if it has not been modified).
  473.        The format for the #T command is always hh:mm, followed by and A
  474.        or P for AM/PM (or a/p for am/pm if #t is used instead).  The
  475.        time format does not usually change based on different COUNTRY
  476.        settings; however the date format switch (/DF) discussed below
  477.        can also be used to specify 24-hour (sometimes called "military"
  478.        time) to be output instead, in which case the A/P is of course
  479.        not present. 
  480.  
  481.  
  482.             The #A template substitution is replaced by the file
  483.        attributes for the file: a combination of read-only, hidden,
  484.        system, and archive or directory (for further information on what
  485.        each of this are used, consult your DOS manual). 
  486.  
  487.             The file attributes are output in a fixed size field of four
  488.        characters (the A and D attributes share the same position).  If
  489.        the attribute is off, it is replaced by an underline: 
  490.  
  491.                RHSA        read-only, hidden, system, archive set
  492.                ___A        only archive set
  493.                _H_D        a hidden directory
  494.  
  495.        The case (upper/lower) of the letters is determined by the case
  496.        of the template substitution letter (#A or #a). 
  497.  
  498.  
  499.             Since the template substitutions can be arranged in any
  500.        order, it is possible to generate directory listings completely
  501.        different from the normal DIR command. 
  502.  
  503.             For example, let's say you want to display the file
  504.        attributes and dates of the files in the root directory of your
  505.        C: drive.  The DOS command to display the attributes is: 
  506.  
  507.                ATTRIB C:\*.*
  508.  
  509.        which displays on my system (as an example): 
  510.  
  511.                 A  SHR     C:\IO.SYS
  512.                 A  SHR     C:\MSDOS.SYS
  513.                 A          C:\CONFIG.SYS
  514.                 A          C:\AUTOEXEC.BAT
  515.                 A          C:\COMMAND.COM
  516.  
  517.        This doesn't tell you the dates of the files -- you would use a
  518.        separate DIR command for that.  NDOS/4DOS allows you to display
  519.        the file attributes with their DIR command, so you could emulate
  520.        the above display by typing the NDOS/4DOS command: 
  521.  
  522.  
  523.  
  524.  
  525.  
  526.                                       -8-
  527.  
  528.  
  529.  
  530.  
  531.  
  532.  
  533.                DIR /T /A:-D /K /M /C /O:U C:\
  534.  
  535.        which would display: 
  536.  
  537.                IO.SYS          33430   4-09-91  5:00a RHSA
  538.                MSDOS.SYS       37394   4-09-91  5:00a RHSA
  539.                CONFIG.SYS       4571   1-10-93 11:34a ___A
  540.                AUTOEXEC.BAT     3278   1-11-93  8:26a ___A
  541.                COMMAND.COM     47845   4-09-91  5:00a ___A
  542.  
  543.        But this gives more information that you wanted, and puts the
  544.        attributes last.  Maybe you'd rather have them first, as in the
  545.        ATTRIB command.  This is no problem for ATBAT; just type
  546.  
  547.                ATBAT "#A #D #F" /A C:\
  548.  
  549.        which would display the following: 
  550.  
  551.                RHSA  4-09-91 IO.SYS
  552.                RHSA  4-09-91 MSDOS.SYS
  553.                ___A  1-10-93 CONFIG.SYS
  554.                ___A  1-11-93 AUTOEXEC.BAT
  555.                ___A  4-09-91 COMMAND.COM
  556.  
  557.        With the template substitutions, you can even reverse the entire
  558.        order of the fields in a typical DIR display: 
  559.  
  560.            ATBAT "#T #D #S #F" C:\
  561.  
  562.        which would display: 
  563.  
  564.                11:34A  1-10-93      4571 CONFIG.SYS
  565.                 8:26A  1-11-93      3278 AUTOEXEC.BAT
  566.                 5:00A  4-09-91     47845 COMMAND.COM
  567.  
  568.  
  569.        Miscellaneous substitutions:
  570.        ----------------------------
  571.  
  572.        #Cnn = skip to output Column nn (if no nn, tabs to 9,17,25 etc.)
  573.  
  574.        In the last example, the template substitution #F displayed
  575.        filenames with the names and extensions concatenated together, as
  576.        they are usually typed on a command line.  But what if you want
  577.        to put the extensions in a separate column, like the DOS DIR
  578.        command (or the /J option of the NDOS/4DOS DIR command)? 
  579.  
  580.             The #C template substitution lets you cause the output of
  581.        ATBAT to "skip" to the output column immediately following the
  582.        #C.  (If no column number is given, the #C skips to the next
  583.        "tab" position which is a multiple of 8, plus 1:  9, 17, 25,
  584.        etc.).  For example, the command: 
  585.  
  586.                ATBAT "#N#C10#E#C13 #S #D  #t" C:\
  587.  
  588.  
  589.  
  590.  
  591.  
  592.                                       -9-
  593.  
  594.  
  595.  
  596.  
  597.  
  598.  
  599.        displays files in a format similar to that of the DOS DIR
  600.        command: 
  601.  
  602.                    col 10  col 13
  603.                         |  |
  604.                CONFIG   SYS      4571  1-10-93  11:34a
  605.                AUTOEXEC BAT      3278  1-11-93   8:26a
  606.                COMMAND  COM     47845  4-09-91   5:00a
  607.  
  608.        To account for all the white space before the size, remember it
  609.        is output in a fixed nine-digit field.  The command
  610.  
  611.                ATBAT "#f#C13#S  #D #t" C:\
  612.  
  613.        mimics the NDOS/4DOS DIR command instead: 
  614.  
  615.                            col 13
  616.                            |
  617.                config.sys       4571   1-10-93 11:34a
  618.                autoexec.bat     3278   1-11-93  8:26a
  619.                command.com     47845   4-09-91  5:00a
  620.  
  621.        Note the use of the lower case #t and #f in the previous examples
  622.        to match the corresponding directory formats. 
  623.  
  624.  
  625.        #V = environment Variable ATBATSUB
  626.  
  627.        If you want to use templates like those above, it's rather
  628.        laborious to type the whole thing over and over again.  Instead,
  629.        you can set up an environment variable ATBATSUB with you favorite
  630.        template: 
  631.  
  632.                SET ATBATSUB #N#C10#E#C13 #S #D  #t
  633.  
  634.        Note that no double quotes are necessary around the template in
  635.        this case. 
  636.  
  637.             You can then type just #V in place of all of those template
  638.        substitutions, i.e.: 
  639.  
  640.                ATBAT #V C:\        is now the same as
  641.        
  642.                ATBAT "#N#C10#E#C13 #S #D  #t" C:\
  643.  
  644.             You can also combine #V with additional template
  645.        substitutions, so if you wanted to add the attributes to the end
  646.        of the directory listing, just type
  647.  
  648.                ATBAT "#V #A" C:\
  649.  
  650.        would display: 
  651.  
  652.                CONFIG.SYS       4571   1-10-93 11:34a ___A
  653.                AUTOEXEC.BAT     3278   1-11-93  8:26a ___A
  654.                COMMAND.COM     47845   4-09-91  5:00a ___A
  655.  
  656.  
  657.  
  658.                                      -10-
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.        #Z = Zap files, same as "del #P"
  666.  
  667.        This one has already been touched on in the Overview, but in case
  668.        you missed it, #Z is simply a shorthand way of writing "del #P",
  669.        since this particular combination seems to come up a lot (at
  670.        least for me, seems like I'm always looking for more room on my
  671.        hard disk!).  Like the other substitutions generating alphabetic
  672.        output, the case of the template substitution determines the case
  673.        of the output (#Z => "del #P", #z => "del #p"). 
  674.  
  675.  
  676.        Other substitutions:
  677.        --------------------
  678.  
  679.        #I replaced by file number (4 digits, zero-filled)
  680.        #J replaced by file number (3 digits, zero-filled)
  681.  
  682.        These two substitutions allow you to create unique filenames for
  683.        every file spec generated.  Say you want to copy all of your
  684.        files named README to one place, called READMES.  If you typed: 
  685.  
  686.            ATBAT "COPY #P \READMES" /S README        (DON'T DO THIS!)
  687.  
  688.        this would copy each of the files on top of each other, and you
  689.        would only end up with one file in the directory.  You can avoid
  690.        this by creating a unique extension for each one, using the #J
  691.        substitution: 
  692.  
  693.            ATBAT "COPY #F.#J \READMES" /S README
  694.  
  695.        This will copy the first file as README.001, the next as
  696.        README.002, and so on.  The #J is replaced by a zero-filled
  697.        number starting with 001 and incremented by one for each new
  698.        matching files specification which meets the given selection
  699.        criteria.  #I is similar, but it is a four digit number starting
  700.        with 0001, suitable for creating up to 9999 temporary filenames,
  701.        such as TEMP#I. 
  702.  
  703.  
  704.        !! replaced by a newline (CR/LF)
  705.  
  706.        So far we have been exploring single line substitutions; but
  707.        ATBAT also has the capability of generating more than one line
  708.        per matching file spec. 
  709.  
  710.             Let's say you want to move a number of files from one
  711.        directory to another.  Standard DOS doesn't have a move command,
  712.        just a copy command -- so you have to do a copy first, and then a
  713.        delete.  The following will do just that: 
  714.  
  715.            ATBAT "COPY #P C:\NEWDIR!!DEL #P" *.TXT
  716.  
  717.        This will generate a COPY command, followed by a DEL command for
  718.        each file ending with .TXT in the current directory.  There is an
  719.        implied !! at the end of every template, unless you suppress it
  720.        with the /N option discussed under options. 
  721.  
  722.  
  723.  
  724.                                      -11-
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.             The !! substitutions will take place both in the template
  732.        and in the text for the text search option /T, discussed below. 
  733.  
  734.  
  735.        %% is replaced by a single %
  736.  
  737.        Often, batch files created by ATBAT are executed and deleted
  738.        right away and not used again.  But sometimes you might want to
  739.        generate a batch file which you will use from the command line
  740.        later on, and want to be able to pass command line parameters to
  741.        it.  Since DOS will try to substitute anything starting with a %
  742.        in your command line passed to ATBAT, you can't simply put a %1
  743.        (for example) in your template and expect it to be in your
  744.        generated batch file.  Instead you need to use double %%'s, as in
  745.  
  746.                ATBAT "PKZIP %%1.ZIP #P" *.DOC /F:ZIPDOC
  747.  
  748.        which creates a batch file that can later be called by typing
  749.  
  750.                ZIPDOC zipname
  751.  
  752.        which in this particular example will compress the same set of
  753.        files ending with the extension .DOC into a .ZIP file whose name
  754.        is given as the first parameter to the batch file. 
  755.  
  756.  
  757.        #]      becomes     >
  758.        #}         "        >>
  759.        #[         "        <
  760.        #!         "        |
  761.        #'         "        "
  762.        #-         "        =
  763.        #_         "        space
  764.        #&         "        (nothing)
  765.        ##         "        #
  766.  
  767.        These substitutions allow you to pass characters to ATBAT that
  768.        otherwise might get interpreted by DOS, such as the redirection
  769.        and pipe characters >, >>, < and |. 
  770.  
  771.             The #& is a concatenation operator that allows you to create
  772.        sequences that might otherwise be misinterpreted by ATBAT; for
  773.        example if you want to tab to the next output column and then
  774.        output a number, you can type #C#&100.  If you had typed #C100
  775.        instead, ATBAT would have used the number as a column to skip
  776.        to. 
  777.  
  778.             These substitutions will take place either in the template
  779.        and in the text for the text search option /T, discussed below.
  780.        Any combination of '#' followed by a character not in the above
  781.        list (or covered earlier) is considered an error. 
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.                                      -12-
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.        Command Line Options
  798.        ====================
  799.  
  800.        All options must be preceded by either a '/' or '-' character,
  801.        and can be type in either upper or lower case.  Each option must
  802.        be listed separately, surrounded by spaces: 
  803.  
  804.                ATBAT #Z /S /X \*.BAK                   <--- do this
  805.        
  806.                ATBAT #Z /SX \*.BAK                     <--- NOT THIS!
  807.  
  808.        Text following an option switch, such as a date or list of
  809.        attributes, should have no embedded spaces.  The only exception
  810.        to this is the text for a /T option, which must be enclosed in
  811.        double quotes if it contains spaces. 
  812.  
  813.  
  814.        Traversing options:
  815.        -------------------
  816.  
  817.        /S   also traverse Subdirectories; /S \*.BAK  is all .BAK files on drive
  818.        /B   like /S, except <only> traverse subdirectories (all files Below)
  819.  
  820.        Like most DOS commands, by default ATBAT only looks at the files
  821.        in the current directory if no explicit path is specified on the
  822.        command line, or at just the specific file specifications
  823.        listed. 
  824.  
  825.             You can also ask ATBAT to traverse subdirectories in
  826.        addition to the current or specified path (the /S switch, present
  827.        in several DOS commands too); or <just> traverse the
  828.        subdirectories below (/B switch) the current or specified one. 
  829.  
  830.             This latter option is rather useful when you want to get rid
  831.        of unneeded files below your current directory, but don't want
  832.        the corresponding files in the current directory deleted.  For
  833.        example, as a programmer I usually create daily directories below
  834.        my current project directory to hold backups of the previous
  835.        day's work.  But I don't really want to keep all the .OBJ files
  836.        around, since they can be regenerated if need be just be doing a
  837.        re-compile.  But if I typed: 
  838.  
  839.                ATBAT #Z /S *.OBJ /X
  840.  
  841.        this would also delete the .OBJ files in my current directory,
  842.        not what I had intended!  (The DEL /S *.BAK command in 4DOS has
  843.        this same limitation.) But by typing
  844.  
  845.                ATBAT #Z /B *.OBJ /X
  846.  
  847.        instead, only the .OBJ files in subdirectories below the current
  848.        one will be deleted. 
  849.  
  850.  
  851.  
  852.  
  853.  
  854.  
  855.  
  856.                                      -13-
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.        Selection options:
  864.        ------------------
  865.  
  866.        /D:mm-dd-yy   select files modified on/after (- means before) Date
  867.        /D:nnn    select files modified >= nnn Days ago (- means <)
  868.        /K:nnnn   select only files >= (- means <) size nnnn (in Kbytes)
  869.        /A:adhrs  select (- don't select) Attributes:
  870.                     Archive/Directory/Hidden/Read-only/System
  871.        /T"text"  select only files containing (- not containing) "Text"
  872.        /I   Ignore case when searching (/T)
  873.  
  874.        Often you don't want to act on a file just based on it's name or
  875.        extension, but want to narrow your selection further.  MS-DOS
  876.        doesn't have much to offer in this area; the FIND and ATTRIB
  877.        commands will display files which contain certain text or have
  878.        selected attributes, but you would have to redirect the output to
  879.        a file and edit it as discussed before. 
  880.  
  881.             File managers, such as Xtree Gold, and the SELECT command in
  882.        NDOS/4DOS let you select a set of files, but you have to
  883.        intervene manually to do so, and cannot automatically build a
  884.        batch file which can be run for example from your AUTOEXEC.BAT
  885.        file. 
  886.  
  887.             ATBAT on the other hand allows you to select files based on
  888.        their last date modification, or their age, size, attributes, and
  889.        whether they contain (or don't contain certain text). 
  890.  
  891.  
  892.             The /D:mm-dd-yy option selects only those files modified on
  893.        or after midnight on the date specified.  (If the file has never
  894.        been modified since it was created, the creation date is used).
  895.        The format for the /D:date command is the same as for the #D
  896.        template substitution discussed earlier, and is based in the
  897.        COUNTRY setting in your CONFIG.SYS file. 
  898.  
  899.             If you immediately precede the date with a minus sign (or a
  900.        'b'), as in /D:-2-9-93, then only files created or modified
  901.        <before> the specified date will be selected. 
  902.  
  903.             You must specify at least two parts of the date for it to be
  904.        recognized as such (otherwise it looks like an age specification,
  905.        discussed next).  ATBAT tries to be fairly intelligent when you
  906.        give it only a partial date; if a number is >= 80 and <= 99, it
  907.        is assumed to be a year in the 20th century (1980 through 1999);
  908.        if it is a number between 00 and 09 (note the leading 0), it is
  909.        assumed to be a year in the 21st century (2000 through 2009).
  910.        Otherwise it is assumed to be a month or day, as appropriate.
  911.        Altogether, nine formats are possible: 
  912.  
  913.                Date style
  914.                ----------
  915.        
  916.                United States       mm-dd-yy  or  mm-yy  or  mm-dd
  917.                European            dd-mm-yy  or  mm-yy  or  dd-mm
  918.                Japanese            yy-mm-dd  or  yy-mm  or  mm-dd
  919.  
  920.  
  921.  
  922.                                      -14-
  923.  
  924.  
  925.  
  926.  
  927.  
  928.  
  929.        If the year is not given, the current year is assumed; except
  930.        that if that would create a date in the future, then last year is
  931.        used.  (So if the current date was July 1, 1993, and the format
  932.        is US, 7-1 would imply 7-1-93, but 7-2 would imply 7-2-92). 
  933.  
  934.             While testing the program, I put in an option to force the
  935.        date format to be a specific one; it turned out to be so handy
  936.        that I have left it in for general use too.  The option is: 
  937.  
  938.                /DF0 selects US format and 12-hour time (AM/PM)
  939.                /DF1 selects European format and 12-hour time
  940.                /DF2 selects Japanese format and 12-hour time
  941.                /DF3 selects US format and 24-hour (military) time
  942.                /DF4 selects European format and 24-hour time
  943.                /DF5 selects Japanese format and 24-hour time
  944.  
  945.        Usually, the specific placement of an option on the command line
  946.        has no effect; but the /DF command is an exception.  If the /DF
  947.        option precedes the /D:date option, it affects the input format;
  948.        and if it follows the /D:date option, it affects only the output
  949.        format.  So it is possible to have one format for input and a
  950.        second for output.  (If there is no /DF command after the
  951.        /D:date, the output format is the same as the input). 
  952.  
  953.  
  954.             The /D:nnn option selects only those files modified at least
  955.        nnn days before the current date and time.  (If the file has
  956.        never been modified since it was created, the creation date is
  957.        used).  If you immediately precede the age with a minus sign, as
  958.        in /D:-30, then only files created or modified less than nnn days
  959.        before the current date and time will be selected. 
  960.  
  961.             The /D:age option is subtly different from the /D:date
  962.        option in the following way: the age version actually uses both
  963.        the current date and time, and subtracts 24 hours times the
  964.        number of days specified to do its comparison.  The date option
  965.        does its comparisons based on date only; the time portion is not
  966.        used.  So if it is 2:00 PM on May 10, 1993, and you typed the
  967.        following command: 
  968.  
  969.                ATBAT #Z /D:-5-10 . /X
  970.  
  971.        all files created/modified before midnight of May 10 would be
  972.        deleted including any files dated the previous day, May 9.
  973.        However the command
  974.  
  975.                ATBAT #Z /D:1 . /X
  976.  
  977.        would select only files at least 24 hours old, and not delete any
  978.        created or modified after 2:00 PM on the previous day. 
  979.  
  980.  
  981.             The /K:nnn option selects only those files whose size in
  982.        kilobytes (1024 bytes = one kilobyte) is greater than or equal to
  983.        that specified.  If you immediately precede the size with a minus
  984.        sign, as in /K:-10, then only files with a size less than nnn
  985.        kilobytes will be selected. 
  986.  
  987.  
  988.                                      -15-
  989.  
  990.  
  991.  
  992.  
  993.  
  994.  
  995.             As in the DOS DIR command, the /A option in ATBAT allows you
  996.        to select (or de-select) files based on their attributes:
  997.        archive, hidden, read-only, system, and directory.  Similar to
  998.        DOS, if the /A switch is given without anything following it,
  999.        then all files are selected, including archive, hidden,
  1000.        read-only, and system.  But there is a difference between ATBAT
  1001.        and DOS:  by default DOS displays directories, and the ATBAT
  1002.        doesn't (the reason being, you typically don't want to select
  1003.        directories as parameters to another DOS command).  So if you
  1004.        want both the directories and files listed, you must explicitly
  1005.        include the /A:D switch. 
  1006.  
  1007.             Putting a minus sign in front of any single attribute says
  1008.        to de-select those files which have the corresponding attribute.
  1009.        You can think of the default switch for ATBAT therefore as being
  1010.        /A:-H-S-D, whereas the default switch for DIR is /A:-H-S. 
  1011.  
  1012.  
  1013.             The /T option allows you to select only those files
  1014.        containing the text immediately following the /T option (which
  1015.        must be enclosed in double quotes if it contains any spaces).
  1016.        Preceding the text with a minus will cause all files which
  1017.        <don't> contain the matching text to be selected.  (If quotes are
  1018.        present, the minus should go before the first quote). 
  1019.  
  1020.             Normally the search is case sensitive; however this can be
  1021.        turned off by including the /I option along with the /T option
  1022.        (the /I can go either before or after the /T). 
  1023.  
  1024.             The various substitutions of '#' followed by a punctuation
  1025.        character (e.g. "#}" replaced by ">>", etc.) take place in the
  1026.        search string as well as the template, to allow special
  1027.        characters which might be interpreted by DOS to be passed to
  1028.        ATBAT. 
  1029.  
  1030.             The !! pair (which is replaced by a newline) causes the text
  1031.        search to be "anchored" at one end of a line or another.  For
  1032.        example, the string -t"!!Feature" will only find the word
  1033.        "Feature" at the beginning of a line, and the string -t"time!!""
  1034.        will only find the word "time" at the end of a line. 
  1035.  
  1036.             The /T option makes ATBAT into a variation of FIND (or
  1037.        FILEFIND, or GREP); except of course with ATBAT you can also be
  1038.        simultaneously selecting based on other criteria, such as file
  1039.        attributes, date of last modification, and size. 
  1040.  
  1041.             Unlike some of the other programs that search files for
  1042.        text, ATBAT always opens files in binary mode which means that
  1043.        you will never get a message like "Line too long, search
  1044.        aborted".  This can be useful if you are searching large .EXE
  1045.        files for a particular text string. 
  1046.  
  1047.  
  1048.  
  1049.  
  1050.  
  1051.  
  1052.  
  1053.  
  1054.                                      -16-
  1055.  
  1056.  
  1057.  
  1058.  
  1059.  
  1060.  
  1061.        Output options:
  1062.        ---------------
  1063.  
  1064.          /F:file   also output to a File (default /F is to replace TEMP.BAT)
  1065.          /E:arq    if output file already Exists, Append, Replace, or Quit
  1066.          /Q   run Quietly -- no /F output echo
  1067.          /X:file   like /F, but also automatically eXecute output file at end
  1068.          /P-  suppress Pause before /X
  1069.  
  1070.        A program is not much use unless you can use its output, and
  1071.        ATBAT is no exception.  Without any specific options, ATBAT
  1072.        writes all of its output to the screen. 
  1073.  
  1074.             However there are really two output streams: all output
  1075.        generated as a result of substitutions in the template (one line
  1076.        for each matching file in the file spec) goes to the "standard
  1077.        output", which can be redirected to a file using the > character
  1078.        in DOS.  All messages, including the banner, error messages, "in
  1079.        progress" messages, and the closing message in the shareware
  1080.        version go to the "standard error" output, which cannot normally
  1081.        be redirected.  (Refer to your DOS manual for more information
  1082.        about redirection using the > and >> character sequences.)
  1083.  
  1084.             One side effect of this arrangement is that it allows the
  1085.        output of the program to "piped" into the input of another using
  1086.        the '|' symbol (for more information about pipes, refer to guess
  1087.        where.)
  1088.  
  1089.             In the earlier examples where we were creating custom
  1090.        directory listings, if added a sort command at the end: 
  1091.  
  1092.                ATBAT "#f#C13#S  #D #t" C:\ | SORT
  1093.  
  1094.        then the files would be sorted in alphabetical order: 
  1095.  
  1096.                autoexec.bat     3278   1-11-93  8:26a
  1097.                command.com     47845   4-09-91  5:00a
  1098.                config.sys       4571   1-10-93 11:34a
  1099.  
  1100.        Since the sort command allows an optional switch (/+nn) to
  1101.        specify the column containing the sort key, the filename does not
  1102.        have to be at the beginning of the line.  ATBAT's #Cnn template
  1103.        substitution can be used to force the filename to a specific
  1104.        column which is then also passed to the sort. 
  1105.  
  1106.  
  1107.             It is also possible to create a batch file using redirection
  1108.        of the standard output, as in the first example of this manual: 
  1109.  
  1110.                ATBAT "DEL #P" /S *.BAK > TEMP.BAT
  1111.  
  1112.        However you will not see the commands going into the file, and if
  1113.        you wanted to check it before executing TEMP, you would have to
  1114.        separately list TEMP.BAT before continuing. 
  1115.  
  1116.  
  1117.  
  1118.  
  1119.  
  1120.                                      -17-
  1121.  
  1122.  
  1123.  
  1124.  
  1125.  
  1126.  
  1127.             The /F file output option gets around that, by causing
  1128.        output to both go to a file and be displayed on the standard
  1129.        output.  It is also safer to use, since if the file specified
  1130.        already exists, ATBAT will ask: 
  1131.  
  1132.            File FILENAME.BAT exists!  A)ppend, R)eplace, or Q)uit?
  1133.  
  1134.        and you must press either the A, R, or Q key to continue
  1135.        (Pressing Escape will also Quit). 
  1136.  
  1137.             If you do not specify a filename after the /F option, then a
  1138.        default filename of TEMP.BAT will be used.  It is replaced by
  1139.        default without asking.  If you specify a filename without an
  1140.        extension, the default extension .BAT is used. 
  1141.  
  1142.             By using the A)ppend option, it is possible to build up a
  1143.        more complicated batch file from several ATBAT commands.  The
  1144.        same affect could be achieved by redirecting the output of the
  1145.        program using >> instead of >, but using redirection the output
  1146.        will not display the output on the screen. 
  1147.  
  1148.             If you want to automatically run ATBAT, say from the
  1149.        AUTOEXEC.BAT file and know in advance is okay replace or append
  1150.        to an existing file, the /E option can be used.  It supplies a
  1151.        default answer (A, R, or Q) to the "File exists" message so the
  1152.        program can continue without pausing. 
  1153.  
  1154.             You may also want to run ATBAT from your AUTOEXEC.BAT and
  1155.        not have any of the usual output displayed; in that case you can
  1156.        specify the /Q option, which inhibits any echoing of the standard
  1157.        output, and also inhibits all "in progress" messages to the error
  1158.        output stream.  So the options: 
  1159.  
  1160.                  /F:file /ER /Q      is equivalent to    > file.BAT
  1161.        
  1162.            and   /F:file /EA /Q      is equivalent to   >> file.BAT
  1163.        
  1164.                  /F /ER /Q           is equivalent to    > TEMP.BAT
  1165.        
  1166.            and   /F /EA /Q           is equivalent to   >> TEMP.BAT
  1167.  
  1168.        So why use all these options, when the redirection looks to be
  1169.        just as easy?  Because there is another variation on the /F
  1170.        option, /X -- which causes the file just created to be executed.
  1171.        If it is the default file TEMP.BAT, it is automatically deleted
  1172.        also.  Without the /X option, you would have to type the name of
  1173.        the batch file after the ATBAT command in order to run it. 
  1174.  
  1175.             To make things even simpler, the /X option can take a
  1176.        filename, in which case it acts like the /F and /X options at the
  1177.        same time.  So: 
  1178.  
  1179.                /X:file     is the same as     /F:file /X
  1180.        
  1181.                /X          is the same as     /F:TEMP.BAT /X
  1182.  
  1183.  
  1184.  
  1185.  
  1186.                                      -18-
  1187.  
  1188.  
  1189.  
  1190.  
  1191.  
  1192.  
  1193.        Because it is rather dangerous to go around executing batch files
  1194.        without knowing what exactly they contain, normally the program
  1195.        pauses just before executing the batch file with the message: 
  1196.  
  1197.               Ready to execute file FILENAME.BAT;
  1198.               press Esc to abort or any other key to continue
  1199.  
  1200.        If you are running ATBAT from your AUTOEXEC.BAT file, or some
  1201.        other time where you would like it to continue without having to
  1202.        press a key, you can inhibit the pause using the /P- switch (note
  1203.        the minus after the P).  But doing so can be very dangerous;
  1204.        please do not use either the /Q or /P- options until you are very
  1205.        familiar with the operation of ATBAT, and have verified that the
  1206.        ATBAT command you are using does exactly what you want it to. 
  1207.  
  1208.  
  1209.        Miscellaneous options:
  1210.        ----------------------
  1211.  
  1212.  
  1213.        /N   suppress automatic Newline for each file
  1214.             (all output goes onto one line)
  1215.  
  1216.        Normally, ATBAT outputs a separate line for each file (plus an
  1217.        extra newline for every !! pair found in the template, as
  1218.        explained in the section on template substitutions). 
  1219.  
  1220.             But there are some situations in which you would like to
  1221.        generate a list of filenames with all of them on the same line.
  1222.        An example of this would be generating a "makefile", used by
  1223.        programmers to automatically re-build a program after one or more
  1224.        of the component files has been updated. 
  1225.  
  1226.             Note that it is possible with the /N option to create a line
  1227.        too long to be executed under as a DOS command, or edited via a
  1228.        text editor, if there are a lot of full pathnames output. 
  1229.  
  1230.             If you insert a !! substitution at then end of a template
  1231.        using the /N option, this will cause a newline to be appended
  1232.        just once, at the end of the entire file.  Otherwise no newline
  1233.        at all will be output (which is sometimes useful if the line is
  1234.        being appended to by another ATBAT command). 
  1235.  
  1236.             The following is a batch file called MAKEBCC.BAT that
  1237.        contains a series of ATBAT commands which automatically generate
  1238.        a makefile for Borland C/C++ (and can be easily modified for
  1239.        other compilers).  It use the names of any object files (.OBJ)
  1240.        already present in the current directory.  (I always seemed to
  1241.        need a makefile only after a project was well underway, and then
  1242.        it was a real chore to create one by hand.  This batch files
  1243.        assumes one is in that situation.)
  1244.  
  1245.             Note the use of variations of the /n option (without and
  1246.        without a !! at the end of the template) to generate partial
  1247.        lines which are appended to by the following command. 
  1248.  
  1249.  
  1250.  
  1251.  
  1252.                                      -19-
  1253.  
  1254.  
  1255.  
  1256.  
  1257.  
  1258.  
  1259.                atbat "%1.exe:" /n /f:%1.mak /er
  1260.                atbat " #f!!" *.obj /n /f:%1.mak /ea
  1261.                atbat "  bcc -e%1.exe" /n /f:%1.mak /ea
  1262.                atbat " #f!!" *.obj /n /f:%1.mak /ea
  1263.                atbat "!!#n.obj: #n.c!!  bcc -c #n.c" *.obj /f:%1.mak /ea
  1264.  
  1265.        For example, if a directory contains the files: 
  1266.  
  1267.                 match.obj
  1268.                 dir2.obj
  1269.                 string2.obj
  1270.                 wildcard.obj
  1271.  
  1272.        and the program to be made is called MATCH, then typing: 
  1273.  
  1274.                MAKEBCC MATCH
  1275.  
  1276.        will generate the following file MATCH.MAK: 
  1277.  
  1278.                 match.exe: match.obj dir2.obj string2.obj wildcard.obj
  1279.                   bcc -ematch.exe match.obj dir2.obj string2.obj wildcard.obj
  1280.        
  1281.                 match.obj: match.c
  1282.                   bcc -c match.c
  1283.        
  1284.                 dir2.obj: dir2.c
  1285.                   bcc -c dir2.c
  1286.        
  1287.                 string2.obj: string2.c
  1288.                   bcc -c string2.c
  1289.        
  1290.                 wildcard.obj: wildcard.c
  1291.                   bcc -c wildcard.c
  1292.  
  1293.        which can be executed by typing MAKE -fMATCH
  1294.  
  1295.  
  1296.        /Hn  display Help screens 1 or 2
  1297.  
  1298.        The easiest way to get on-line help is simply to type ATBAT
  1299.        without anything following the command.  Two screens will be
  1300.        output, the first summarizing the command line syntax and
  1301.        available template substitutions, and the second summarizing the
  1302.        command line options. 
  1303.  
  1304.             You can also force either of the help screens to appear by
  1305.        typing /H1 or /H2; this is useful, for example if you have typed
  1306.        in a long ATBAT command and then forgotten the syntax for one of
  1307.        the switches.  You can just add /H2 to the end of the line: 
  1308.  
  1309.                ATBAT #Z /S /K10 /D7 C:\*.BAK D:\*.BAK G:\*.BAK /H2
  1310.  
  1311.        and the help screen will appear, temporarily ignoring the rest of
  1312.        the line.  When done, press the key used to retype the last DOS
  1313.        command line (usually F3), and then backspace over the /H2 and
  1314.        continue your command. 
  1315.  
  1316.  
  1317.  
  1318.                                      -20-
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.        /R   how to get a Registered copy of this shareware program
  1326.  
  1327.        To register this program, you can print out an order form by
  1328.        typing: 
  1329.  
  1330.                ATBAT /R >PRN
  1331.  
  1332.        The instructions for registering will be output to the screen
  1333.        (error output) and the order form itself output to standard
  1334.        output (redirected to the printer in this case).  See the section
  1335.        below on Registration for more information about the benefits of
  1336.        registering this program. 
  1337.  
  1338.  
  1339.        File Specifications
  1340.        ===================
  1341.  
  1342.        Following the template (with possibly some options in-between) is
  1343.        a list of one or more file specifications.  These may be
  1344.        individual file names, but more likely will have wildcards to
  1345.        specify a range of files, such as *.BAK.  ATBAT allows both the ?
  1346.        and * wildcards allowed by DOS (refer to your DOS manual for more
  1347.        information about wildcards). 
  1348.  
  1349.             You can have any number of file specs on the command line;
  1350.        for example: 
  1351.  
  1352.                ATBAT #Z /S C:\*.BAK D:\*.BAK TEMP /X
  1353.  
  1354.        which would delete all .BAK files on drives C and D, and all
  1355.        files named TEMP in the current directory (and below).  Each of
  1356.        the files that match the file specification are then matched
  1357.        against any other selection criteria, such as file attributes,
  1358.        size, date and text string.  Only those files that pass all the
  1359.        above checks will be substituted into the template. 
  1360.  
  1361.  
  1362.        File of Filenames (@Files):
  1363.        ---------------------------
  1364.  
  1365.        If a list of specific files needs to be selected on a repetitive
  1366.        basis, you can use @files.  These contain just filenames, with or
  1367.        without wildcards.  (You can use ATBAT of course to generate your
  1368.        @files, using just #F or #P as a template).  For example, if the
  1369.        file @BAKS contained the following: 
  1370.  
  1371.                C:\*.BAK
  1372.                D:\*.BAK
  1373.                TEMP
  1374.  
  1375.        then the previous example: 
  1376.  
  1377.                ATBAT #Z /S C:\*.BAK D:\*.BAK TEMP /X       becomes
  1378.        
  1379.                ATBAT #Z /S @BAKS /X
  1380.  
  1381.  
  1382.  
  1383.  
  1384.                                      -21-
  1385.  
  1386.  
  1387.  
  1388.  
  1389.  
  1390.  
  1391.        Error Codes and Messages
  1392.        ========================
  1393.  
  1394.        ATBAT returns a status code upon program termination, which can
  1395.        be tested with the DOS IF ERRORLEVEL command (this is useful if
  1396.        you are running ATBAT within a batch file).  If no errors were
  1397.        encountered, and at least one file was processed, the exit value
  1398.        is zero.  Otherwise it is set as follows: 
  1399.  
  1400.                Exit value      Meaning
  1401.                ----------      -------
  1402.                    0           Normal exit
  1403.                    1           No files were found meeting criteria
  1404.                    2           No template, or bad substitution char,
  1405.                                or bad option, or help screen requested
  1406.                    3           Error executing batch file (/X option)
  1407.  
  1408.  
  1409.        Shareware
  1410.        =========
  1411.  
  1412.        Shareware distribution gives users a chance to try software
  1413.        before buying it.  If you try a Shareware program and continue
  1414.        using it, you are expected to register. 
  1415.  
  1416.             Copyright laws apply to both Shareware and commercial
  1417.        software, and the copyright holder retains all rights, with a few
  1418.        specific exceptions as stated below.  Shareware authors are
  1419.        accomplished programmers, just like commercial authors, and the
  1420.        programs are of comparable quality.  (In both cases, there are
  1421.        good programs and bad ones!) The main difference is in the method
  1422.        of distribution.  The author specifically grants the right to
  1423.        copy and distribute the software, either to all or to a specific
  1424.        group. 
  1425.  
  1426.             Shareware is a distribution method, not a type of software.
  1427.        You should find software that suits your needs and pocketbook,
  1428.        whether it's commercial or Shareware.  The Shareware system makes
  1429.        fitting your needs easier, because you can try before you buy.
  1430.        And because the overhead is low, prices are low also.  Shareware
  1431.        has the ultimate money-back guarantee -- if you don't use the
  1432.        product, you don't pay for it. 
  1433.  
  1434.             ATBAT 1.0 is a "shareware program" and is provided at no
  1435.        charge to the user for evaluation.  Feel free to share it with
  1436.        your friends, but please do not give it away altered or as part
  1437.        of another system.  The essence of "user-supported" software is
  1438.        to provide personal computer users with quality software without
  1439.        high prices, and yet to provide incentive for programmers to
  1440.        continue to develop new products. 
  1441.  
  1442.  
  1443.  
  1444.  
  1445.  
  1446.  
  1447.  
  1448.  
  1449.  
  1450.                                      -22-
  1451.  
  1452.  
  1453.  
  1454.  
  1455.  
  1456.  
  1457.        Registration
  1458.        ============
  1459.  
  1460.        If you find this program useful, and continue to use ATBAT after
  1461.        a reasonable trial period you must register it.  Basic
  1462.        registration costs just $15.  To print out a registration form,
  1463.        either run the program with the /R option, e.g. 
  1464.  
  1465.            ATBAT /R >PRN
  1466.  
  1467.        or print the file ORDER.DOC (which is a combination order form
  1468.        and self-contained mailer): 
  1469.  
  1470.            PRINT ORDER.DOC
  1471.  
  1472.        When you register, you will receive the latest version of ATBAT
  1473.        (without the registration reminder message at the end of the
  1474.        program), and be eligible for three months of technical support
  1475.        (either by telephone, limited to a total connect time of 30
  1476.        minutes; or via FAX, CompuServe email, or regular mail).  Plus
  1477.        you will receive the latest shareware versions of other programs
  1478.        from SOFTWEST. 
  1479.  
  1480.             In addition to the basic registration, you can also order a
  1481.        deluxe printed version of this manual for just $7.50.  It is
  1482.        identical in content to the one you are reading, but is easier to
  1483.        read since it is laser printed using multiple fonts, boldface and
  1484.        italics (something impossible to do with just a straight ASCII
  1485.        file).  The printed version has also an index and table of
  1486.        contents. 
  1487.  
  1488.             You can also order the complete source code for ATBAT for
  1489.        only $20.00.  It is set up to compile under both Microsoft C/C++,
  1490.        Version 5.1 or later, and Turbo/Borland C/C++, Version 2.0 or
  1491.        later, and can be used to make custom versions of the program for
  1492.        your own use. 
  1493.  
  1494.             The basic registration fee will license one copy for use on
  1495.        any one computer at any one time.  You must treat this software
  1496.        just like a book.  An example is that this software may be used
  1497.        by any number of people and may be freely moved from one computer
  1498.        location to another, so long as there is no possibility of it
  1499.        being used at one location while it's being used at another. 
  1500.  
  1501.             Corporate users of ATBAT must register and pay for their
  1502.        copies of ATBAT within 30 days of first use or their license is
  1503.        withdrawn.  Site licenses (ten or more copies at the same
  1504.        address) may be obtained by contacting SOFTWEST. 
  1505.  
  1506.             Anyone distributing ATBAT 1.0 for any kind of remuneration
  1507.        must first contact SOFTWEST (see VENDOR.DOC for more
  1508.        information).  This authorization will be automatically granted
  1509.        to distributors recognized by the Association of Shareware
  1510.        Professionals (ASP) as adhering to its guidelines for shareware
  1511.        distributors, and such distributors may begin offering ATBAT 1.0
  1512.        immediately. 
  1513.  
  1514.  
  1515.  
  1516.                                      -23-
  1517.  
  1518.  
  1519.  
  1520.  
  1521.  
  1522.  
  1523.             You are encouraged to pass an unaltered copy of the
  1524.        shareware version of ATBAT 1.0 along to your friends for
  1525.        evaluation.  Please encourage them to register their copy if they
  1526.        find that they can use it. 
  1527.  
  1528.             By registering your copy of ATBAT 1.0, you will be
  1529.        encouraging future versions of the program.  I hope you enjoy
  1530.        using ATBAT, and let me know what you would like to see in the
  1531.        next version. 
  1532.  
  1533.                                                        -- Tom Crosley
  1534.                                                           January, 1993
  1535.  
  1536.  
  1537.  
  1538.  
  1539.  
  1540.  
  1541.  
  1542.  
  1543.  
  1544.  
  1545.  
  1546.  
  1547.  
  1548.  
  1549.  
  1550.  
  1551.  
  1552.  
  1553.  
  1554.  
  1555.  
  1556.  
  1557.  
  1558.  
  1559.  
  1560.  
  1561.  
  1562.  
  1563.  
  1564.  
  1565.  
  1566.  
  1567.  
  1568.  
  1569.  
  1570.  
  1571.  
  1572.  
  1573.  
  1574.  
  1575.  
  1576.  
  1577.  
  1578.  
  1579.  
  1580.  
  1581.  
  1582.                                      -24-
  1583.  
  1584.  
  1585.