                           - 1 -
Tue 8-November-2005

About TSBAT in General                         (All rights reserved)
======================

Ŀ
 Please do not distribute any part of this package separately. 
 If you come upon such a distribution or a reproduction on an  
 unauthorized WWW page, please alert the author.               


This package may be used and distributed freely for NON-COMMERCIAL,
NON-INSTITUTIONAL, PRIVATE purposes, provided it is not changed in
any way. (Repacking with another method is ok, though.) For ANY
other usage, such as use in a business enterprise or at a
university, contact the author for registration. Uploading to
bulletin boards is encouraged.

You are free to quote brief passages from this package provided you
clearly indicate the source with a proper acknowledgment. Other than
that the material is covered by the usual international copyrights.
Also the composition of the question index is copyright protected.
It may not be repeated as an index of FAQs for other Operating
Systems or command interpreters without a written permission of the
author.

If you have comments about the this collection, please do not
hesitate to use electronic mail for communication. But if you wish
to have individual batch problems or programming consultation,
please post your questions to a suitable Usenet newsgroup like
news:comp.os.msdos.misc or news:comp.os.msdos.programmer. It is much
more efficient than asking me by email. I'd like to help, but I am
very pressed for time. I prefer to pick the questions I answer from
the Usenet news. Thus I can answer publicly at one go if I happen to
have an answer. Besides, newsgroups have a number of readers who
might know a better or an alternative answer. Don't be discouraged,
though, if you get a reply like this from me. I am always glad to
hear from fellow users.

You'll find some suggestions, improvements, and corrections from
helpful Usenet users in the ftp://garbo.uwasa.fi/pc/pd2/tspost*.zip
information and feedback files. See tspost00.zip for the index of
the said files. See the end of the current file for same pointers.

These batches and the information are for MS-DOS with the
command.com interpreter, i.e. vanilla MS-DOS. Some of the tricks may
not work properly a such on a DR-DOS system or with the 4DOS command
interpreter because of their subtle incompatibilities with the
vanilla MS-DOS. Furthermore, in the Windows 95/98/Me MS-DOS box there
may be subtle problems with batches written for MS-DOS, since in the
new "MS-DOS 7.0" some of the accustomed features no longer are in
effect. Furthermore, the long filenames instead of the 8+3
convention can also cause baffling problems for some of the material
if run in the Windows 95/98/Me dos box. However, most of the
material will be usable under those systems.

For Windows NT/2000/XP etc the situation is radically different
since they are based on a diverging OS philosophy and their main
command line interpreter (cmd.exe) uses syntax which crucially
differs from the command.com syntax. There also is a slow
command.com emulator for these platforms, but there are crucial
incompatibilities. Nevertheless, many of the batch files included
will work as such on NT/2000/XP.

The author shall not be liable to the user for any direct, indirect
or consequential loss arising from the use of, or inability to use,
any program, batch or file howsoever caused. No warranty is given
that the batches, the programs or the advice given will work under
all circumstances.

Timo Salmi (email: ts@uwasa.fi WWW: http://www.uwasa.fi/~ts/)
Professor of Accounting and Business Finance
Faculty of Business Studies
University of Vaasa
P.O. BOX 700, FIN-65101 Vaasa, Finland


                           - 2 -

Contents of Timo Salmi BATches. The batches are self-documenting.
But also see tsbat.nws news file for tips and information.

TSBAT82         Batch file collection, T.Salmi
Filename        Comment
--------        --------------------------------
1BATFAQ.TXT     Assorted batch tricks and tips
1DOSTRIK.TXT    Assorted MsDos tricks and tips
1PATH.TXT       How to beat the 127 byte limit
1PROMPT.TXT     Tips on prompt usages with ansi
1READMAI.TXT    ReadMail setting for FAQ reading
ADDPATH.BAT     Append directories to the path
APATH-OM.BAT    Otto Makela's version of addpath
ARC2ZIP.BAT     Single .arc to .zip with comment
ASK.EXE         Ask questions in a batch file
ASKENV.EXE      Ask, returning environment value
BASENAME.EXE    Extract file name from full name
BASEPATH.EXE    Extract path name from full name
BASEXTEN.EXE    Extract file extension from name
BDIR.BAT        Bare list - count of directories
BLANK.BAT       Poor man's screen saver
BLK.BAT         Poor man's screen saver + popup
BOOT.BAT        Choose your boot configuration
BOOTW.BAT       Different boots choices for BOOT
C.BAT           Lazy changing of directory
CD.AUX          Auxiliary ascii file for pushit
CLRBUF.EXE      Clear the key ahead buffer
COLORMAP.BAT    Ansi screen color esc. seq. map
COLORS.BAT      Set screen color attributes
D.BAT           Directory with sort + wildsearch
DAILY.BAT       Run a program only once a day
DATEDIR.BAT     Display all files updated today
DELDIR.BAT      Remove directory and its files
DELPATH.BAT     Delete a directory from the path
DOSHIS.BAT      Store/restore command history
ECHON.EXE       echo -n, Echo without a linefeed
EXE2ZIP.BAT     Self-extracting file into a zip
FILE_ID.DIZ     Brief characterization of TSBAT
FU.BAT          Poor man's function evaluator
GFIND.BAT       Combine Garbo index files info
HEX.BAT         Add and subtract hexadecimals
LASTBOOT.BAT    Show date + time of previos boot
LC.BAT          Line count for text files
LEVEL.BAT       Testbench for program errorlevel
LINK1.BAT       How to link batch files together
LINK2.BAT       Batch link demo's second file
LOCATE.BAT      Wildcard file find
LOGRUN.BAT      Log program usage + time and run
LOOP.BAT        An index loop demonstration
M.BAT           Give multiple MsDos commands
MAKESURE.BAT    Simple command.com virus warning
MENU.BAT        Run programs from a menu
MVE.BAT         Move file to another directory
M_TSBAT.BAT     A makefile to build this package
POPDIRE.BAT     Restore (pop) saved directory
POPPATH.BAT     Restore the saved path
PORTS.BAT       Display port base I/O addresses
PUSHDIRE.BAT    Non-resident push directory
PUSHIT.BAT      Alternative pushing of directory
PUSHPATH.BAT    Save the current path
REPEAT.BAT      Repeat command to several files
REPLY.BAT       How to give input within a batch
REZIP.BAT       Remove zip authenticity labels
RULER.BAT       Show screen columns
RUN.BAT         Testing for viruses
SAFEDEL.BAT     Safe delete of files
SAMENAME.BAT    Display drive's files by name
SAMESIZE.BAT    Display drive's files by size
SCANZ.BAT       Scan for viruses (incl. execomp)
SCOPY.BAT       Copy a file with a single device
SETCOM.BAT      Secure your command.com
SETPRN.BAT      Set an Epson compatible printer
SHOW.BAT        Wildcard multifile type command
SHOWTIME.BAT    Show current date and time
SKIP.BAT        Perform commands, skipping files
SUBS.BAT        Make current dir a subst drive
SWEEP.BAT       Go recursively thru directories
TEST33.BAT      Test for MsDos 3.3 or later demo
TESTANSI.BAT    Has ANSI.SYS been loaded?
TOUCH.BAT       Touch a file's datetime stamp
TSBATIDX.TXT    The 1BATFAQ.TXT index separately
TSBATINF.TXT    Document (a readme)
TSBATNWS.TXT    News concerning this package
TSPROG.TXT      List of programs from Timo Salmi
UNPACK.BAT      Unpack-test-view any archivetype
VAASAINF.TXT    Info: Finland, Vaasa, U of Vaasa
VIRAL.BAT       Another batch-based virus test
WEEKLY.BAT      Run program(s) once a week
WHERE.BAT       Generic searchstring fname find
WILD.BAT        Wildcard any command
ZIPDATE.BAT     Equate .zip date to latest file
ZOO2ZIP.BAT     Single .zoo to .zip with comment
----            ------             ------  -----
0086


Questions, feedback, alternatives, and improvements from the users:
==================================================================

tspost28.txt
------------
From: rlively@earthlink.net (Rick Lively)
To: "Prof. Timo Salmi" <ts@uwasa.fi>
Subject: Security batch file and "solid" zip archives
Date: Sun, 28 Oct 2001 22:41:33 -0600

From: "Eric Pement" <pemente@northpark.edu>
To: ts@uwasa.fi
Subject: improvement on TSBAT
Date: Wed, 4 Apr 2001 20:23:10 -0500

From: Clifford Stern <ax810@lafn.org>
To: Timo Salmi <ts@uwasa.fi>
Subject: Testing for zero byte file
Date: Tue, 13 Mar 2001 09:34:44 -0800

From: afn21533@afn.org (Robert G. Durnal)
To: ts@uwasa.fi (Timo Salmi)
Subject: Testing for disk presence in a batch
Date: Mon, 18 Dec 2000 15:13:22 -0500 (EST)

From: ts@UWasa.Fi (Timo Salmi)
To: Kerry Davis <kedavis@uswest.net>
Subject: Re: DOS batch file page
Date: Sat, 25 Nov 2000 08:06:41 +0200 (EET)

From: ts@UWasa.Fi (Timo Salmi)
To: Philip Carley <philip.carley@cmg.nl>
Subject: Re: DOS command.
Date: Thu, 21 Sep 2000 07:06:28 +0300 (EET DST)

tspost27.txt
------------
From: Dominik Hudzik <dominik.hudzik@etobres.com.pl>
To: Timo Salmi <ts@UWasa.fi>
Date: Thu, 19 Aug 1999 13:32:32 +0200
Subject: solution for out of memory

From: walter@wbriscoe.demon.co.uk (Walter Briscoe)
Newsgroups: comp.archives.msdos.d
Date: Sun, 21 Mar 1999 11:06:12 +0000
Subject: Re: tsbat58.zip A collection of useful batch files and tricks

From: micm@melbpc.org.au (Michael Marquart)
To: ts@uwasa.fi (Timo Salmi)
Date: Thu, 11 Mar 1999 17:09:12 GMT
Subject: Basic In batch files

From: ts@uwasa.fi (Timo Salmi)
To: rlively@earthlink.net (Rick Lively)
Date: Fri, 6 Nov 1998 06:33:56 +0200 (EET)
Subject: Re: Batch file trick: zero-length file

From: rookwood@suburbia.com.au (John Savage)
Date: Sun, 5 Jul 1998 21:22:57 +1000
Subject: Re: out of environment space?

From: ralf@conactive.com (Ralf Buschmann)
Date: Mon, 25 May 1998 07:03:24 GMT
Subject: Re: Day of week in a batch?

From: ts@uwasa.fi (Timo Salmi)
To: MEADE@MERLIN.ARC.NASA.GOV (Perry Meade)
Date: Wed, 22 Apr 1998 06:32:29 +0300 (EET DST)
Subject: Re: Your Batch utilities and NT

From: Peter Wright <pwright@accesswa.com.au>
Date: Wed, 15 Apr 1998 09:16:41 +0800
Subject: The great date extraction problem in MS-DOS batch

tspost26.txt
------------
From: "ANGUITA, HORACIO ENRIQUE" <bn813754@intbba1.buenayre.com.ar>
Date: Tue, 27 Jan 1998 11:39:20 -0800
Subject: Batch Env_trick

tspost25.txt
------------
From: "James Nash" <james59@mdx.ac.uk>
Date: Wed, 16 Oct 1996 16:39:34 GMT
Subject: Batch trick # 25

From: vernon.frazee@sunshine.com (Vernon Frazee)
Date: 15 Sep 96 07:07:44 -0400
Subject: LEVEL.BAT / EL.BAT

tspost24.zip
------------
From: Mark Rogers <mcr@holly.demon.co.uk>
Date: Tue, 30 Apr 96 20:16:07  GMT
Subject: Re: TSBAT48 - Some thoughts....

From: ts@uwasa.fi (Timo Salmi)
To: dwayne.sterling@fastdrs.com (Dwayne Sterling)
Date: Sun, 10 Mar 1996 07:40:21 +0200 (EET)
Subject: Re: tsbat46.zip batch tricks

From: Don Costello <costello@illuminet.net>
Date: Wed, 21 Feb 96 23:55:02 PST
Subject: Re: Your batch tips/tricks -- GREAT!

From: Lars Alexandersen <lalexand@diku.dk>
Date: Sat, 10 Feb 1996 19:33:08 +0100 (MET)
Subject: A batch to show the errorlevel

tspost23.zip
------------
From: jrusnak@MIT.EDU (John Rusnak)
Date: Wed, 23 Aug 1995 18:04:00 EDT
Subject: Random numbers with a batch file

From: klee@mistress.informatik.unibw-muenchen.de (Herbert Kleebauer)
Date: Mon, 7 Aug 1995 12:59:35
Subject: Re: A comment on tsbat47.zip

From: adimare@cariari.ucr.ac.cr (Adolfo Di Mare)
Date: Sun, 28 May 1995 10:39:25 -0600 (CST)
Subject: recursive whereis.bat

tspost22.zip
------------
From: lordsoth@ix.netcom.com (Joseph Seymour)
Date: Fri, 10 Feb 1995 01:04:07 -0800
Subject: Re: Redirection in batch files

tspost21.zip
------------
From: ts@uwasa.fi (Timo Salmi)
To: benzion@HUM.HUJI.AC.IL (Cassouto Ben-Zion Y.)
Date: Sun, 4 Sep 1994 22:41:14 +0300 (EET DST)
Subject: Re: base????.exe programs in tsbat46.zip

From: ts@uwasa.fi (Timo Salmi)
To: jmcging@access.digex.net (John McGing)
Date: Sun, 21 Aug 1994 08:24:48 +0300 (EET DST)
Subject: Re: TSBAT45 and DRDOS6

tspost19.zip
------------
From: "CLAUS FISCHER" <WI00227@wipool.wifo.uni-mannheim.de>
Date: Fri, 18 Feb 1994 15:34:39 CET
Subject: Update for Timo's FU.BAT

From: Remco Broekhoff <100041.3006@CompuServe.COM>
Date: 23 Feb 94 05:00:11 EST
Subject: tsbat: lastboot.bat -> BOOTREC.BAT

From: grether@wsuaix.csc.wsu.edu (ed grether)
Date: Sat, 19 Dec 92 18:03:03 PST
Subject: Review of TSBAT40.ZIP

tspost18.zip
------------
From: David Pickles <D.M.Pickles@bristol.ac.uk>
Date: Thu, 6 Jan 94 16:35:45 GMT
Subject: Re: Re-boot from a batch file?

From ts@uwasa.fi Thu Feb  3 21:45:46 1994
Subject: Re: PUSHDIRE.BAT & POPDIRE.BAT
To: kfagans@nyx.cs.du.edu (Kenn R. Fagans)

tspost17.zip
------------
From: mcr@holly.demon.co.uk (Mark Rogers)
Subject: TSBAT / User input in .BAT files / A little ingenuity
Date: Thu, 14 Oct 1993 00:48:45 +0000

From: mcr@holly.demon.co.uk (Mark Rogers)
Subject: tsbat - level.bat improvements
Date: Mon, 15 Nov 1993 13:31:44 +0000

tspost16.zip
------------
From: ccml@hippo.ru.ac.za (Mike Lawrie)
Subject: getdrv.bat
Date: Sun, 13 Jun 1993 22:09:41 +0200 (EET)

From: mcr@holly.demon.co.uk (Mark Rogers)
Subject: Re: Dos Errorlevel
Date: Sun, 29 Aug 1993 17:06:30 +0000

tspost13.zip
------------
From: rcmcc@canis.bellcore.com (Ron McConnell)
Date: Thu, 4 Feb 93 12:55:22 EST
Subject: ruler.bat

From ts@uwasa.fi Sat Feb 13 07:18:25 1993
Subject: Re: a batch programming question
To: bmaggio@dcs.bellcore.com (Bill Maggio)

tspost12.zip
------------
From: pete@quake.sylmar.ca.us (Pete Benjamin)
Date: Wed, 21 Oct 92 13:12 PDT
Subject: FYI - A mod for ruler.bat that includes the tens position.

tspost10.zip
------------
From: Richard Kaye <KAYE@vax.oxford.ac.uk>
Date: Mon Jun 29 15:30:55 1992
Subject: TSBAT, alternative ERRORLEVEL code

From: ts@uwasa.fi (Timo Salmi)
Date: Tue, 18 Aug 1992 05:20:17 GMT
Subject: A batch programming contest for you
