home *** CD-ROM | disk | FTP | other *** search
-
- BATLOG 1.0
-
- FlatLand Software
- Tracy Mickley
- Copyright 1991
-
- Batlog was designed to aide debugging and logging activity of complex
- DOS batch files. Batlog will create a running ASCII text file named BATLOG.LOG
- and log your activity each time it is run. Batlog will also execute a *.EXE or
- *.COM file and log the 'shelled' program DOS ERRORLEVEL upon termination. In
- addition Batlog will log, upon request, available drive space and directory
- listings.
-
- WARRANTY
-
- There is no warranty expressed or implied. FlatLand Software will assume
- no liability for any damages or loss of use to your hardware, software or data
- through your use of Batlog.
-
- OPERATION
-
- You insert Batlog with it's command line switches and comments into your
- batch files to track it's progress and to create an audit trail for later
- review. Simply type Batlog followed by optional command line switches along
- with any comment you want included in the batlog.log file. The optional command line
- switches can be placed anywhere on the command line. I tend to put them after
- the comments I want logged since it makes it easier to read the comments later. Run
- BATLOG a couple times, look at the BATLOG.LOG output file and you'll see it is
- a simple program to run and use constantly. A brief help screen will be
- displayed when you enter BATLOG with no command line arguments.
-
- SWITCHES
-
- /A:x = available drive space left in bytes. This can be any valid
- drive letter. If no drive letter is specified the default drive is checked
- and logged.
-
- /D:*.* = Directory listing is functionally similar to the DIR
- command in DOS with the exception that if no files argument is given,
- the switch is ignored. Wildcards (* and ?) are honored.
-
- /E:x = Errorlevel exit where x is a number from 0 to 255. This
- tells Batlog to return to DOS with the specified errorlevel. I haven't
- figured out a real good use for this yet, but it's there if you want to
- use it.
-
- /O:filename.ext = Optional output filename. This allows you to
- change the default output filename from BATLOG.LOG to any valid
- filename and path.
-
- /R:filename.ext = Runs the specified filename. This switch allows
- you to execute most any *.EXE or *.COM file and log the errorlevel it returns.
- Batlog will end with this same errorlevel. Note you must provide the full
- path and filename, including the extension if specified file is not in the same
- directory as Batlog. If the specified program is in the same directory as
- Batlog, you must still use the full filename with extension. If you find a
- returned error level of -254, this means you didn't supply the full filename
- with extension. This switch will also allow command line arguments to be passed
- to the program being executed.
-
- Here's an example:
-
- BATLOG toss the Fido mail /r:tossmail.com -100 -.arc -new
-
- Now you've got a commented log file with 'toss the Fido mail' and told
- Batlog to execute the tossmail.com program with it's required switches. Batlog
- will exit with any DOS errorlevel that tossmail.com returns so it can be acted
- on in your batch file. See ABOUT BAT FILES for more on how to use
- DOS ERRORLEVELS and why this command is very useful.
-
- /N:filename.exe = identical to the /R: switch except that Batlog
- will terminate with a 0 errorlevel instead of the executed programs returned
- errorlevel.
-
- Here's a typical batlog run.
-
- BATLOG Check for existing *.bas files and run ask.exe /a: /d:*.bas /r:ask.exe
-
- (Note: A Batlog command line can be 128 characters long and may wrap on your
- screen as you enter your comment and switch settings.)
-
- Here's the sample result excerpt from the log file:
-
- =====================================================================
- 10-23-1991 14:03:07
- Check for existing *.bas files and run ask.exe /a: /d:*.bas /r:ask.exe
- Disk space :4536320 bytes available on drive
- Files matching :*.bas
- TEST2.BAS 18635 08-31-91 08:15p
- TEST3.BAS 22058 10-21-91 09:52p
- TEST1.BAS 15833 08-31-91 08:09p
- Execute File :ask.exe
- Returned from File :ask.exe with ERRORCODE 3
- ERRORLEVEL set on exit is: 3
- =====================================================================
-
- The first line is the time and date of this batlog run. This will always be
- there in any run. The second line is the command line comment and switches.
- Note that you can place a comment either before or after your switch settings.
- The third line shows the result of the /a: switch and gives you the amount of
- available space on your drive. We used the default drive by not specifying a
- drive letter. Any valid drive letter can be used. The third line shows the
- result of the /d: switch. This requested a directory of all files matching the
- *.bas parameter. Much as you would from the command line prompt. Lines 5
- through 7 show which files are there. Line 8 shows that we had Batlog execute
- a program named ASK.EXE. Line 9 shows Batlog has resumed control and that
- ASK.EXE returned an errorlevel code of 3. The last line shows that Batlog then
- exited with an errorlevel of 3.
- ABOUT BAT FILES
-
- Most programs will exit a program with an ERRORLEVEL passed to DOS
- if the program aborts abnormally. Many programs use the DOS ERRORLEVEL
- as a method of communicating results of the programs execution. Often times
- this is documented. Often times it's not. You can use the /r: switch in
- Batlog to find out which ERRORLEVELS you are getting and write your batch
- file to react accordingly. A lengthy explanation of how to use batch file
- ERRORLEVELS is beyond the scope of these doc's. Indeed many entire chapters
- have been devoted to it's use. I'll provide one brief example. Let's say we
- have a program called tossmail.com and it when it executes it will return
- three different ERRORLEVELS when it terminates; 0, 1 and 2. 0 in this example
- says it executed with no problems. 1 indicates it didn't find any mail to
- toss and 2 indicates it tried to process the mail but the disk is full. Here's
- a small hypothetical batch file:
-
- rem example batch file
- :TOP
- BATLOG Run the bbs program
- BBS.EXE
- BATLOG Got some mail in, now toss it /r:tossmail.com -c:\mail
- if errorlevel 2 goto packdisk
- if errorlevel 1 goto nomail
- if errorlevel 0 goto top
- :packdisk
- BATLOG Pack the disk to make room /a:c: /r:packdisk.exe
- if errorlevel 1 goto packfailed
- goto top
- :nomail
- BATLOG Didn't get any mail in /d:c:\mail\*.pk?
- goto top
- :packfailed
- BATLOG Still too full so check drive space /a:c:
- goto top
- end
-
- This bat runs the bbs.exe program. When the bbs program exits it falls
- to the next line in the batch file which is the tossmail.com program invoked
- from BATLOG. (Note the command line switch "-c:\mail" for tossmail.com is also
- passed.) Now tossmail.com exits and then BATLOG will log the error level
- tossmail terminated with and will exit with the same error level. The batch
- file checks for the error level with the "if errorlevel" lines. If the
- errorlevel is 2, the batch file jumps to the :packdisk label where the
- available disk space is logged and then a packing program is run via BATLOG
- and then jumps back to the :top label to start it all over again. If the
- packdisk.exe program exits with an errorlevel of 1, it jumps to the :packfailed
- label and BATLOG makes note of it and checks the available space again so you
- can act on it later to add more into your batch file to handle this
- circumstance. That's it in a nutshell but will give you an idea of how useful
- BATLOG can be.
-
- LIMITATIONS NOTE:
- The shell feature has worked with everything I've tossed at it
- but I'm sure there is something somewhere it won't shell out. Most likely
- this will be an instance where this not enough memory to invoke the child
- process. The /r: (shell) command does not invoke another COMMAND.COM. You
- should make a point of testing all applications invoked with the /r: command
- before you use it in important automated routines.
-
- SUPPORT BBS:
- Support and upgrades can be found on:
-
- TEXT bbs
- FlatLand Software
- 12/24/96/14.4baud USR Dual Standard
- 1-701-239-6048
- Fido node 288/6
-
- REGISTRATION COST:
- Registration for license is $15.00. The second license is $10.00.
- Additional licenses are $5 for the next 18 copies. You can register on-line on
- TEXT bbs using Mastercard/VISA on TEXT bbs or send check/money order to
- FlatLand Software. You may also mail-in a credit card registration using the
- registration form at the end of this file. Company purchase orders will be
- honored by invoice billing. The latest version is available by disk for an
- additional $5.00. All registration fees are US funds.
-
- LICENSE:
- You have license to test this program for 14 days. If you find it useful
- and continue to use it, you need to register it. License is like a book.
- This allows you to use it on one machine at a time per licensed copy. If you
- have it installed on more than one machine, then you need more than one license.
- Automated use on different machines at different times is not use like a book.
- Site licenses are available. Contact FlatLand Software at TEXT bbs.
-
- FlatLand Software
- Tracy Mickley
- 3113 24 Ave SW
- Fargo, ND 58103 USA
-
- Program name and version #:__________________________________
-
- Name:_______________________________________________________
-
- Address:____________________________________________________
-
- City, State, Zip:___________________________________________
- (Province and Postal Code if Canadian)
-
- If mail-in credit card registration:
- Name as it appears on card:_________________________________
-
- Credit Card Number:_________________________________________
-
- Expiration Date:____________________________________________
-
- Authorized Signature:_______________________________________
-
- ADDENDUM: OTHER FLATLAND SOFTWARE
-
- Tstat - A TBBS dayfile analyzer that tracks all bbs activity.
- Ustat - A TBBS user analyzer that tracks all bbs user activity.
- Himess - A TBBS utility that helps to prevent message base numbers from
- exceeding 65000
- Tratio - A TBBS utility that allows automated D/L bytes limits from
- upload ratios.
- Tbill - Again for TBBS. Currently under development. Creates comma
- delimited output files for time billing use for dBase or TDBS
- programs.