News on the TSBAT batches package by Timo Salmi in reverse order
================================================================

University of Vaasa, Finland, Linux  Pentium  garbo.uwasa.fi  has  a
large  collection  of  Shareware,  Freeware  and  Public  Domain  PC
programs available by anonymous FTP, WWW (World Wide Web)  and  mail
server.  The  file ftp://garbo.uwasa.fi/pc/ts/0news-ts contains news
about the TS-programs in the /pc/ts directory  (in  reverse  order).
This  text, which you now have, is an extract from the 0news-ts file
and the Usenet news.

....................................................................
Prof. Timo Salmi   Co-moderator of news:comp.archives.msdos.announce
Moderating at ftp:// & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance  ; University of Vaasa
mailto:ts@uwasa.fi <http://www.uwasa.fi/~ts/>  ; FIN-65101,  Finland
Dense spam-kill procmail filtering with a public email key in effect
....................................................................

Tue 19-Apr-2005: I have made an update of my MS-DOS batch FAQ
collection. Since I no longer have an MS-DOS PC available, all the
new testing has been done on a Windows95 PC. This dos not, however,
imply that the collection has changed its, in some cases limited
MS-DOS specific nature.
  ftp://garbo.uwasa.fi/pc/link/tsbat.zip
  tsbat82.zip Useful MS-DOS batch files and tricks, T.Salmi
The collection includes a number of References/Comments using
Google links. Google's system has changed, so some of the old
notation no longer worked. The syntax has been seen to.
  Added a directory history capability to "C.BAT Lazy changing of
directory".
Added to the 1BATFAQ.TXT FAQ file
 166) How do I uppercase all the filenames in a directory?
 167) How can I create a one byte file? Not two, one.

Tue 19-Apr-2005: I have made an update
  ftp://garbo.uwasa.fi/pc/link/tsbat.zip
  tsbat81.zip Useful MS-DOS batch files and tricks, T.Salmi
I am crossposting the announcement also to news:comp.os.msdos.4dos
as an exception since 4DOS usages have been introduced into my
MS-DOS(+Win../95/98/Me) command.com batch FAQ. Two new items have
been added
 164) How do I write 4DOS-aided batch files under COMMAND.COM?
 165) How to test if a directory contains any files with long names?
The latter item utilizes the ideas in the former.
As usual, some of the old items have been slightly revised.

Tue 12-Oct-2004: Made an update
  250909 Oct 12 2004 ftp://garbo.uwasa.fi/pc/link/tsbat.zip
  tsbat.zip Useful MS-DOS batch files and tricks, T.Salmi, linked
Alternatively available with a version number as
  ftp://garbo.uwasa.fi/pc/ts/tsbat80.zip
Added for demonstration
 M_TSBAT.BAT "A makefile to build this package"
Made some minor textual corrections to the "1BATFAQ.TXT Assorted
batch tricks and tips" part. The fact is that the development of
MS-DOS batches is petering out. In a sense they have become "mature"
and there is little additional left to do on the original MS-DOS
scene. The development has shifted to NT/2000/XP (and beyond)
command line scripts. In fact, I have a collection of their own for
them distributed as
 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
 Useful NT/2000/XP script tricks and tips
Because of the said developments in the system environments, I have
added appropriate tests in several, but not quite all, of the
included batches. In those, if a NT/2000/XP and/or a Win95/98/Me
environment is detected, the batches are now made to exit with a
timely notification. On the other hand, a number of the batch files
in the TSBAT collection still work perfectly well all trough the
MS-DOS+Win../95/98/Me and NT/2000/XP continuum.

Sat 27-Dec-2003: Another minor update to adjust some of the
information
  ftp://garbo.uwasa.fi/pc/link/tsbat.zip
or, alternatively, with a version number as
  ftp://garbo.uwasa.fi/pc/ts/tsbat79c.zip

Wed 29-Oct-2003: Just a very minor update correcting some typos etc
  ftp://garbo.uwasa.fi/pc/link/tsbat.zip
or, alternatively, with a version number as
  ftp://garbo.uwasa.fi/pc/ts/tsbat79a.zip

Sat 11-Oct-2003: When a FAQ collection has been around for long, the
corrections and additions come far apart. Furthermore, the potential
new tasks usually can be solved with minor variations of the old
material. Such rehashing does not truly add anything. Therefore, the
latest update of my MS-DOS batch FAQ really mostly is cosmetic even
if it has been almost a year since the last update. The update is
available as
  ftp://garbo.uwasa.fi/pc/link/tsbat.zip
or, alternatively, with a version number as
  ftp://garbo.uwasa.fi/pc/ts/tsbat79.zip

Tue 17-Dec-2002: I have updated my MS-DOS batches FAQ by adding the
following new items and made a few refinements into some of the old
items.
 159) How can I convert a Unix text file to MS-DOS? And vice versa?
 160) How do I add a space after every fourth character on a line?
 161) How do I get all but the last line, and replace last by "End"?
 162) How can I calculate how many times "e" occurs in my text file?
 163) Is it possible to concatenate two text files side by side?
The package is available as
  ftp://garbo.uwasa.fi/pc/link/tsbat.zip
or, alternatively, with a version number as
  ftp://garbo.uwasa.fi/pc/ts/tsbat78.zip

Sun 27-Oct-2002: I have updated my MS-DOS batches FAQ by adding the
following new items and made refinements into several of the old
 152) Can I remove the comment from all .zip files in a directory?
 153) A NOT in batch? E.g. copy a directory's all but .exe files.
 154) I need the for loop to append info to an environment variable?
 155) How do I remove consecutive duplicate lines from a file?
 156) How can I columnize a single column into columns of e.g. five?
 157) Is it possible to sort a text file by the length of its lines?
 158) Can I get the full file names AND the file size and datestamp?
The package is available as
  ftp://garbo.uwasa.fi/pc/link/tsbat.zip
or, alternatively, with a version number as
  ftp://garbo.uwasa.fi/pc/ts/tsbat77.zip

Wed 28-Aug-2002: The following new items have been added to my
updated MS-DOS batch tips and tricks collection
  ftp://garbo.uwasa.fi/pc/link/tsbat.zip
also available as
  ftp://garbo.uwasa.fi/pc/ts/tsbat76.zip
 149) A batch to compare which of two files is the more recent?
 150) Can I convert DEC to HEX in a batch file, and vice versa?
 151) How do I find and print the longest line in a text file?
Some minor corrections and additions have been made to the already
existing items.

Wed 17-Apr-2002: I have added the following items to my MS-DOS batch
FAQ collection
 145) How do I insert a pagebreak into a textfile every 25th line?
 146) Is it possible to count how many times a batch has been called?
 147) Can I enter a password to batch without it being echoed?
 148) How can I create a dummy file with a given filesize?
The update is available as
  ftp://garbo.uwasa.fi/pc/link/tsbat.zip
and alternatively with the version number as
  ftp://garbo.uwasa.fi/pc/ts/tsbat75.zip

Thu 28-Mar-2002: I have made an update of
  ftp://garbo.uwasa.fi/pc/link/tsbat.zip
that is (with the version number)
  ftp://garbo.uwasa.fi/pc/ts/tsbat74.zip
  A collection of useful batch files and tricks
Extended several of the old items and added the following new ones:
 139) How can I cut a textfile at, say 8000 characters?
 140) How can I remove all empty lines from a text file?
 141) Can I calculate factorials in a batch? Do I need recursion?
 142) How can I extract or delete a range of lines from my textfile?
 143) How do I get the week number? What about the day of the year?
 144) How do I rename myfile.txt to myYYMMDD.txt with current date?

Fri 1-Mar-2002: I have again updated my FAQ-like batch information
collection. It now is
  ftp://garbo.uwasa.fi/pc/ts/tsbat73.zip
  A collection of useful batch files and tricks
Also available as ftp://garbo.uwasa.fi/pc/link/tsbat.zip
As usual, some of the old items have been augmented and these new
ones added:
 135) Can one calculate the difference between two times in a batch?
 136) Is it safe to use debug or other similar tools in batches?
 137) How can I retrieve a keyword from a text file into environment?
 138) How to find if there is an identical file elsewhere on my HD?

Wed 6-Feb-2002: Made the update
  ftp://garbo.uwasa.fi/pc/ts/tsbat72.zip
  A collection of useful batch files and tricks
Alternatively ftp://garbo.uwasa.fi/pc/link/tsbat.zip
Added
 128) How can I add date and time to each line of a text file?
 129) Is a column-sensitive search possible through a text file?
 130) How can I calculate the number of words in a text file?
 131) How can I put the lines of a text file into a reverse order?
 132) How can I add 5:23:11 to the current time?
 133) How do I find out the number of parameters given to my batch?
 134) How to remove the first two characters throughout my text file?
As usual have also added some more alternatives and references to a
few of the already existing items.

Wed 16-Jan-2002: It is time for my MS-DOS batch trick collection
update. It now is
  ftp://garbo.uwasa.fi/pc/ts/tsbat71.zip
  A collection of useful batch files and tricks
Also available for convenience of WWW-referencing without the
version number as ftp://garbo.uwasa.fi/pc/link/tsbat.zip
  The previous release was made on Mon 5-Nov-2001.
  Added CLRBUF.EXE "Clear the key ahead buffer" little batch
enhancer to do just what the brief description says. Particularly
useful if there is a loop of input.
Added five new items
 123) How I can (re)set the screen text and background colors?
 124) How do I get the echo status into an environment variable?
 125) How can I delete all empty directories on a drive?
 126) How can I put an = into an environment variable?
 127) How can I reverse a word or an entire line?
Made some small additions to the existing items, such as: Added to
item #88 a method for detecting whether the FIND version you have
returns an errorlevel or not. Added to item #34 a quick and dirty
method for getting the system year into an environment variable.
Added playing a tune into the item #82.

Mon 5-Nov-2001: I have once again added new items to my consequently
updated
  ftp://garbo.uwasa.fi/pc/ts/tsbat70.zip
  A collection of useful batch files and tricks
118) How to put the content of text file into a variable?
119) How do I get the three oldest and latest files of a directory?
120) Hint: Displaying an ASCII (hex) value table
121) How to make %0 include the full path of the called batch file?
122) How can I test if a file is dated less than hour ago?
   As usual, there are some more solutions to the already existing
items, as well. E.g. Changed the item
 95) How can I test for a zero byte file?
to be
 95) How can I test for a zero byte file? Or against a larger size?

Thu 25-Oct-2001: I have updated my batch tips collection to now be
  ftp://garbo.uwasa.fi/pc/ts/tsbat69.zip
  A collection of useful batch files and tricks
Added more solution versions to a considerable number of the old
items in the principal file 1BATFAQ.TXT "Assorted batch tricks and
tips". In some cases several. The size of the tips file has grown
nearly 30 kilobytes in this rendition. The additions are much due to
echon.exe, cut.exe, sed.exe, gawk.exe and fn.exe based new
solutions. But nothing previous has been withdrawn.
The item
 99) Is it possible to echo without linefeed like the Unix echo -n?
gives the Turbo Pascal source code for the task. Included a compiled
ECHON.EXE into the updated package for those gentle readers who do
not have and do not wish to search the web for the TP compiler.
Added the reference only items
 113) What is difference between MS-DOS and various Windows batches?
 114) Is it possible to display comments from the config.sys file?
Added also the items
 115) Can I split a single command over multiple lines in a batch?
 116) How can I get yesterday's date into an environment variable?
 117) How do I get the 3rd word from the 5th line of a text file?

Sat 29-Sep-2001: Updated my
  ftp://garbo.uwasa.fi/pc/ts/tsbat68.zip
  A collection of useful batch files and tricks
Added the new items
 110) Is it possible to delete lines by their line numbers only?
 111) How can I tell what drive has been allocated by ramdrive.sys?
 112) How can in insert a line in the middle of a file with a batch?
Inserted a GAWK based alternative solutions to the items
   3) Is it possible to nest for loops in batch files?
  39) How can I extract the file basename?
  75) How can I rename all files sequentially in a directory?
  93) How do I add +1 to a variable in a batch?
Added a SED based solution alternative to the item
  38) Is it possible to echo the redirection symbol in a batch?
Added another solution alternative to
 106) How do I get the last drive into an environment variable?
The file is from now also available also without the version number
as ftp://garbo.uwasa.fi/pc/link/tsbat.zip for easier permanent
reference.

Thu 8-Mar-2001: Updated my batch tips collection to now be
  ftp://garbo.uwasa.fi/pc/ts/tsbat67.zip
  A collection of useful batch files and tricks
Added a few alternative options and tricks to the old items and
prepared the new items
 105) How can I determine if ANSI.SYS is loaded?
 106) How do I get the last drive into an environment variable?
 107) How can I calculate the number of lines in a file?
 108) Is it possible to save and later restore the command history?
 109) Is it possible to change just one line of a file with a batch?

Tue 13-Feb-2001: I have made an update
  ftp://garbo.uwasa.fi/pc/ts/tsbat66.zip
  A collection of useful batch files and tricks
I have added alternative solutions to a few of the old ones. Mostly
G(nu)AWK-based. I have also added the following new items
 103) How do I find the largest numeric extension and add +1 to it?
 104) How do I run the latest executable from the default directory?

Wed 24-Jan-2001: I have again updated my FAQ-like collection of
MS-DOS batch tips and trick. It now is
  ftp://garbo.uwasa.fi/pc/ts/tsbat65.zip
Added
 100) How can I detect the F1-F10 function keys in a batch?
 101) How can I get the free size and total size of a drive?
 102) How can I search for a string through a directory of files?
Also added alternative solutions to some of the old items.

Wed 10-Jan-2001: Updated my FAQ-like MS-DOS batches tips collection
to be
  ftp://garbo.uwasa.fi/pc/ts/tsbat64.zip
Added a QBASIC alternative to the items
 59) How get today's date into a six-character environment variable?
 63) How can I extract the drive letter from a full file path?
 83) Y2K: My old BIOS gives a wrong year at boot. How can I fix it?
 95) How can I test for a zero byte file?
Added the items
 98) How to read a file's attributes into environment variables?
 99) Is it possible to echo without linefeed like the Unix echo -n?

Mon 4-Dec-2000: Made an update of my MS-DOS batches and tips
collection. It now is
  ftp://garbo.uwasa.fi/pc/ts/tsbat63.zip
Added the following new items to the batch questions & answers
collection
 93) How do I add +1 to a variable in a batch?
 94) How to copy the errorlevel into a variable in a batch?
 95) How can I test for a zero byte file?
 96) How to show the last N lines of a file using DOS batch files?
 97) How do I get the path of a file located somewhere on my disk?

Fri 22-Sep-2000: Made the update
  ftp://garbo.uwasa.fi/pc/ts/tsbat62.zip
to add the following new items
 90) Isn't MS-DOS dead with W2K? So why bother with MS-DOS batches?
 91) How can I exit the called batch without returning to the first?
 92) How do I create a sequence of directories from 001 to MaxValue?

Fri 31-Mar-2000: Made an update of my MS-DOS batches collection to
be
  ftp://garbo.uwasa.fi/pc/ts/tsbat61.zip
Added the following three FAQ items
 87) How can I test for the existence of a substring in a string?
 88) How can I put MS-DOS FIND results into an environment variable?
 89) How to get months as letters and years in four digits in DIR?

Fri 11-Feb-2000: I have updated by collection of MS-DOS batch
files and tricks. It now is
  ftp://garbo.uwasa.fi/pc/ts/tsbat60.zip
Added the following new items:
 83) Y2K: My old BIOS gives a wrong year at boot. How can I fix it?
 84) Is there a batch to drop the first letter of a file name?
 85) How do I close the command window once my batch file has run?
 86) Is MS-DOS batch programming going to die along with W2K?
   Added "Check if a directory contains files or not" into the
already existing item: 46) How can I test whether a disk is empty or
not?

Sun 16-Jan-2000: Made a maintenance update
  ftp://garbo.uwasa.fi/pc/ts/tsbat59.zip
  A collection of useful batch files and tricks
It includes one new item
 82) How would I get a beep in a batch file?
Mostly, however, it just updates some minor version and Y2K
information.

Sun 14-Mar-99: I updated of my "collection of useful batch files and
tricks to be
  ftp://garbo.uwasa.fi/pc/ts/tsbat58.zip
I have changed the format FAQ text files slightly so that they can
optionally be more easily read also with various email programs. I
have included a 1READMAI.INF file with brief instructions for
alternatively using Netscape, Unix elm or MS-DOS ReadMail to browse
the items. The advantage with the Netscape option is that then
you'll have all the contained links immediately clickable. I also
added the new items
 78) Is there a batch to individually zip each file in a directory?
 79) A batch to substitute a string through a set of text files?
 80) Where do I find a good book or WWW page on batch programming?
 81) How to read a file's date and time into environment variables?
 D10) How can I delete a file/directory with a space in the name?
Added a QBASIC solution alternative to the item
 40) A batch to put user input into an environment variable
Added another solution version to the item
 68) How can I compare two numbers with batch commands?

Sat 12-Dec-98: I updated of my "collection of useful batch files and
tricks to be
  ftp://garbo.uwasa.fi/pc/ts/tsbat57.zip
I have added to 1BATFAQ.TXT the following new items
 73) How can I check the number of parameters given to a batch?
 74) How can I locate and e.g. delete all *.TMP files on a drive?
 75) How can I rename all files sequentially in a directory?
 76) How to search all the *.txt files on a drive for a word?
 77) How can I give multiple commands on one line?
I also put some new material and clarifications in a few of the old
items.

Sat 11-Jul-98: I have made an update of my "collection of useful
batch files and tricks: ftp://garbo.uwasa.fi/pc/ts/tsbat56.zip
adding to 1BATFAQ.TXT
 70) How can I give more than the nine parameters to a batch? '
 71) How can I update copy files from one directory to another?
 72) How can I best clear all the files from my TEMP directory?
and to 1DOSTRIK.TXT
 D9) What does "Out of environment space" mean? How do I get more?

Sat 20-Jun-98: I have made a major update
 ftp://garbo.uwasa.fi/pc/ts/tsbat55.zip
 A collection of useful batch files and tricks
To begin with, corrected the fatal errors in the item
 41) Getting the last replaceable parameter
Replaced an old, duplicate item by
 56) Could you please solve this problem for me with a batch?
Added the new items
 67) How can I extract the first two characters of a file name?
 68) How can I compare two numbers with batch commands?
 69) All these solutions are for wimps. Why not rather use 4DOS?
   To emphasize the FAQ nature of the batch tricks, I renamed within
the package the text files. At the same time I put them first in the
archive package to separate them from the individual batch files.
  New name      Description                      Old name
  --------      -----------                      --------
  1BATFAQ.TXT   Assorted batch tricks and tips   BATRICKS.TXT
  1DOSTRIK.TXT  Assorted MsDos tricks and tips   DOSTRICK.TXT
  1PATH.TXT     How to beat the 127 byte limit   PATH.TXT
  1PROMPT.TXT   Tips on prompt usages with ansi  PROMPT.TXT
Since the items in 1BATFAQ.TXT (the former BATRICKS.TXT) are batch
FAQ-type of items, I have converted most of the item titles into the
form of batch users' questions. In going through the items I have
added a lot of further explanations and done extensive editing.

Sun 10-May-98: Made an update
 ftp://garbo.uwasa.fi/pc/ts/tsbat54.zip
 A collection of useful batch files and tricks
Added the following new items to BATRICKS.TXT
 59) How get today's date into a six-character environment variable?
 60) How can I find and copy the files updated today in a directory?
 61) How can I test in a batch whether a TSR program has been loaded?
 62) Putting the current drive letter into an environment variable.
 63) How can I extract the drive letter from a full file path?
 64) How can I write a "SLEEP" command to pause for a certain time?
 65) How can put comments into a batch file?
 66) How can I echo just the word "off" in a batch file?
Rewrote
 TESTANSI.BAT "Has ANSI.SYS been loaded?"

Fri 6-Mar-98: I have updated my collection of useful batch files
and batch tricks. It is now
     ftp://garbo.uwasa.fi/pc/ts/tsbat53.zip
Added the following new items to BATRICKS.TXT
 56) How can I test if a batch is running in a Windows dosbox?
 57) How can I make a loop that is repeated a preset number of times?
 58) How can I display the contents of the memory?
Added alternative methods or additional information to the items
  4) Checking whether a directory exists
 38) Echoing the redirection symbol
and made some minor adjustments to some other items.
Added the missing
 REPEAT.BAT Repeat command to several files

Sat 4-Oct-97: I have updated my frequently asked batch programming
questions and batch files collection to be
 135427 Oct 4 16:49 ftp://garbo.uwasa.fi/pc/ts/tsbat52.zip
 tsbat52.zip A collection of useful batch files and tricks, T.Salmi
I have added the following items to BATRICKS.TXT within the package
 50) How can I traverse all files of a directory in a batch?
 51) How can I step through a batch a command at a time to debug it?
 52) How to find all files made or updated on a day or today?
 53) How can I make a list of all my files and locate a certain file?
Item #53 also explains how to locate all hidden files on your
harddisk.
 54) How can I tell if a program is running in a Windows dosbox?
 55) How can a test that there is a disk in a floppy disk drive?
Also added to DOSTRICK.TXT
 8) Bypassing or stepping through config.sys and autoexec.bat

Sun 17-Nov-96: I have updated my collection of batch files and the
FAQ-like batch tips. The updated collection is
     ftp://garbo.uwasa.fi/pc/ts/tsbat51.zip
The new tips added are
 48) Can one put line numbers into a file with just batch commands?
 49) How can I backup from the current directory files made today?
Added two alternative solutions to the item
 34) Enticing the current date into an environment variable
Many of the batches have been adjusted for the possibility of having
the users ramdrive (or other working disk) at a customizable
location given as an environment variable %ram% in the user's
autoexec.bat.

Sun 1-Sep-96: I have updated my collection of batch files, tips and
tricks to be ftp://garbo.uwasa.fi/pc/ts/tsbat50.zip. Added the
following items
 46) How can I test whether a disk is empty or not?
 47) How can I run a different batch depending on the weekday?
Added a batch-only solution to
 39) Getting the file basename.
Added the following new batch files:
 SAMENAME.BAT Display drive's files sorted by name
 SAMESIZE.BAT Display drive's files sorted by size

Sun 26-May-96: I have updated by collection of batch files, tips and
tricks to be ftp://garbo.uwasa.fi/pc/ts/tsbat49.zip. Added the
following items
 43) How can I change or remove the disk volume serial number?
 44) How to pause in a batch for a preset number of seconds?
 45) Where can I find a program to compile batches into COMs or EXEs?
Put elm compatible headers in all the items to facilitate the
reading of the advice files with greater variety of tools.

Sun 28-Apr-96: Added the following items into BATRICKS.TXT in my
collection of batch files ftp://garbo.uwasa.fi/pc/ts/tsbat48.zip
  41) Getting the last replaceable parameter
  42) Creating an empty file if the file does not already exist
Added to PROMPT.TXT the a option to example how to display the time
with the prompt command.

Sat 5-Aug-95: Added to my collection of useful batch files and
tricks a new batch
  "SKIP.BAT Perform commands, skipping files"
because the simple trick of excluding particular files from a
command is so often asked.
Added to BATRICKS.TXT a new item
 40) A batch to put user input into an environment variable
It is the neatest batch programming trick I have ever seen. It
remedies the biggest (alleged) flaw in MS-DOS batch programming,
that is getting user input without any external programs.
  The update is ftp://garbo.uwasa.fi/pc/ts/tsbat47.zip.

Mon 30-Jan-95: My collection of useful batch files and tricks
includes the file "DOSTRICK.TXT Assorted MS-DOS tricks and tips"
which in turn has the item "7) Selected Doskey macro examples". I
have added descriptions and material to that item. Also made some
small additions of text to the file "BATRICKS.TXT Assorted batch
tricks and tips". These are parts of my updated
 garbo.uwasa.fi:/pc/ts/tsbat46a.zip
 A collection of useful batch files and tricks

Sun 4-Sep-94: I have a collection of useful batch files and batch
tricks, which I have updated. It is now garbo.uwasa.fi:/pc/pd2/
tsbat46.zip.
Added the following items to DOSTRICK.TXT
 4) Stepping trough config.sys and autoexec.bat command by command.
 5) Getting rid of "Insert diskette for drive B:"
 6) Conditional deleting of files
 7) Selected Doskey macro examples

Tue 31-May-94: I have updated my collection of useful batches and
batch tricks. It is now garbo.uwasa.fi:/pc/ts/tsbat45.zip.
 - Added a list of user feedback to the TSBAT.INF file
 - Added item 39) Getting the file basename
 - Added optional batch enhancers:
     BASENAME.EXE Extract file name from full name
     BASEPATH.EXE Extract path name from full name
     BASEXTEN.EXE Extract file extension from name
 - Added
     DOSTRICK.TXT Assorted MS-DOS tricks and tips

Sat 15-Jan-94: I have updated my collection of useful batches and
batch tricks. It is now garbo.uwasa.fi:/pc/ts/tsbat44.zip. Added the
following items to batricks.txt:
 37) Traversing a directory tree
Added an related demonstration batch SWEEP.BAT.
 38) Echoing the redirection symbol
Rewrote and added material to
 24) Redirecting a batch file's output
 30) How to obtain the MsDos version into an environment variable
Updated
 PATH.TXT  "How to beat the 127 byte limit"
 SCANZ.BAT "Scan for viruses (incl. execomp)"

Sat 8-May-93: I have updated by collection of useful batches and
batch tricks to be garbo.uwasa.fi:/pc/ts/tsbat43.zip by adding the
following items to batricks.txt.
 31) Finding out the number of regular files on a drive
 32) Augmenting line numbers to a text file
 33) Storing and returning to the original directory (push and pop)
 34) Enticing the current date into an environment variable
 35) Identifying the individual PC
 36) For loop and redirection quirks
I have updated by adding a second method to
 7)  Convert a parameter to uppercase
Also a few minor updates to some of the batches.

Tue 2-Mar-93: I have updated by collection of useful batches and
batch tricks to be garbo.uwasa.fi:/pc/ts/tsbat42.zip by adding the
following items to batricks.txt.
 26) A simple trick to "disable" a drive
 27) Sending an escape sequence to the printer
 28) Creating a random string
 29) Finding out the length of a string
 30) How to obtain the MsDos version into an environment variable
Added GFIND.BAT "Combine Garbo index files info". It is a
specialized batch for combining the information from Garbo MsDos FTP
archives file index files INDEX.ZIP, _dir.zip and _file.zip. GFIND
is also available in Unix format as garbo.uwasa.fi:/pc/ts/gfind

Sat 30-Jan-93: I have updated by collection of useful batches and
batch tricks.
 Added
  SUBS.BAT        Make current dir a subst drive
 Updated
  BATRICKS.TXT    Assorted batch tricks, plus added
    24. Redirecting a batch file's output
    25. Testing for environment space sufficiency
  PROMPT.TXT      Tips on prompt usages with ansi

Sat 19-Dec-92: Update garbo.uwasa.fi:/pc/ts/tsbat40.zip of my
collection of useful batch files and batch tips & tricks. Added
  BDIR.BAT  "Bare list & count of directories"
  HEX.BAT   "Add and subtract hexadecimal values"
  PORTS.BAT "Display port base I/O addresses"
Updated and rewrote
  BATRICKS.TXT "Assorted batch tricks"
Corrected
  COLOR.BAT "Set screen color attributes"
It left on a tmp_ environment value.  It shouldn't have.

Mon 26-Oct-92: I have again updated my collection of useful batch
files and batch tricks. It is now garbo.uwasa.fi:/pc/ts/tsbat39.zip.
   Added COLORMAP.BAT "Ansi screen color esc. seq. map". I adapted
the idea from PC Computing October 1992. The difference in my
adaptation is that it displays the escape sequence codes you need to
induce the colors on the map. Furthermore, I do not use any
environment variables.
   Added TOUCH.BAT "Touch a file's datetime stamp". It is quite
amazing the thing one can actually do with bare batch files using
the tricks trade.  TOUCH.BAT is a good example of this.
   Added EDIT.BAT "A truly trivial text editor". Appends text to a
text file from the con device, that is the keyboard.
   Made some enhancements to BATRICKS.TXT "Assorted batch tricks"
and added the following item:
 21) Testing if a file name includes a path

Sun 20-Sep-92: I have again updated my collection of useful batch
files and batch tricks. It is now garbo.uwasa.fi:/pc/ts/tsbat38.zip.
   WEEKLY.BAT "Run program(s) once a week" is a new batch in my
collection. If you want to run a program once a week when you reboot
your computer, put
  CALL WEEKLY Weekday YourApplicationName [Param1] [Param2] [...]
in your autoexec.bat file. Only one application, or one set of
applications, can be run on the same weekday with this batch. The
application can be a different one for each weekday.
Examples: CALL WEEKLY Mon YourApplication
          CALL WEEKLY Tue echo Time to back up^G^G^G
          CALL WEEKLY Fri call YourBatchOfManyPrograms
No auxiliary programs outside the normal MsDos commands have been
used in WEEKLY.BAT. Not easy, but it can be done.
   DAILY.BAT "Run a program only once a day" which you call call
from your autoexec.bat relies on the MsDos external FC command. The
output of this command has been rewritten in MsDos 5.0. DAILY.BAT
did therefore not work for MsDos version 5.0.  I have consequently
rewritten DAILY.BAT to comply also with the MsDos 5.0 version. A
similar amendment has been done to VIRUS.BAT "Another batch-based
virus test".
   BOOT.BAT "Choose your boot configuration" now utilizes nu
NOBOOT.EXE from garbo.uwasa.fi:/pc/ts/tstsr12.zip (or whichever is
the current version number) if it is available. This is to prevent
the user from accidentally being too hasty about rebooting while the
batch is still running.
   LASTBOOT.BAT "Show date + time of previous boot" streamlined to
show just the date and time without the confusion of referring to
the previous boot with "Current date is" which MsDos date (and time)
produce.
   PROMPT.TXT "Tips on prompt usages with ansi" has some additional
information on key redefinitions.
   BATRICKS.TXT added the following new items:
19. Utilizing the subst command in paths
20. How to run a batch once a week (testing for the weekday)
   Some other, minor amendments.

Sun 30-Aug-1992: I have updated my collection of useful batch files
and batch tricks. It is now garbo.uwasa.fi:/pc/ts/tsbat37.zip.
   BATRICKS.TXT "Assorted batch tricks" now also explains how to
extract the extension from a file name, how to prevent breaking a
batch, how to avoid auxiliary batches, and much more.
   PUSHDIRE.BAT "Non-resident push directory" has been totally
rewritten and is now self-contained. The external auxiliary program
SETPUSHD.EXE is no longer needed, and has been omitted from the
collection. The companion program POPDIRE.BAT has been brought up to
date. Both the batches can take an /s (show) switch. See the remarks
within the batches for more information.
   DELPATH.BAT "Delete a directory from the path" has been rewritten
so that it creates the auxiliary file that it needs as a temporary
file. Thus SETVAR.BAT is not longer needed in beforehand and has
been eliminated from the collection.
   UNPACK.BAT "Unpack-test-view any archivetype" does not need, nor
allow an extension in the archive name because it know how to detect
the type of the archive. The batch now first checks that the user
has not mistakenly given an extension. UNPACK.BAT also treats the
other error situations in a more informative manner than before.
   D.BAT "Directory with sort & wildsearch" uses implicit wildcards
to match anywhere in the file name(s). The batch now checks that the
users soes not enter explicit wildcards to D.BAT.
   LOCATE.BAT "Wildcard file find". Added an optional /p paging
switch. Clarified the instructions.
   WILD.BAT "Wilcard any command". Corrected the simple case of no
command given to wild.bat to jump out.
   ARC2ZIP.BAT "Single .arc to .zip with comment" has been rewritten
to check more closely to correct input format. Likewise the renamed
ZOO2ZIP.BAT and EXE2ZIP.BAT. ARC2ZIP.BAT is now harddisk oriented
like the two others, since working on floppies can be now considered
rare.
   Some other minor changes and rewrites of the batches and their
documentation. (The batches are self-documenting.)

Thu 6-Aug-92: I have updated my collection of useful batch files and
batch tricks. It is now garbo.uwasa.fi:/pc/ts/tsbat36.zip. Among the
updates and enhancements are
   C.BAT "Lazy changing of a directory" has been enhanced. The basic
idea is that if you are tired of typing the backslash (\), C.BAT
lets you use an easier syntax.  For example if you have a directory
on the current drive called \text\jokes\stupid you can apply the
form "c text jokes stupid" without needing the backslash. If you
type c alone, it takes you to the root directory. Now C.BAT can
handle drives too, and at one go at that. For example of you are on
the C: drive and your directory is on D: you can apply
                c d: text jokes stupid
The beauty of the system is that the "d:" is optional, that is the
batch can identify whether the first parameter indicates a drive or
not.
   BATRICKS.BAT is a new addition. It covers assorted batch tricks
from the batches in the TSBAT collection, and also a number
additional tricks that are not covered in the in the actual batches.
   BOOT.BAT "Choose your boot configuration" now sounds a warning
bell if you choose an non-existing boot configuration. My own
selection new has four alternative boots, but you can easily adjust
to yours. To logic is rather straight-forward. Also a couple of
typos in the rem comments have been corrected.
   PROMPT.TXT "Tips on prompt usages with ansi" has some new
clarifications.
   SCANZ.BAT "Scan for viruses (incl. execomp)" has been brought up
to date.
   VAASA.INF "Info: Finland, Vaasa, U of Vaasa, our faculty, Timo"
has been updated. This file is included in most of my program
packages.
   There are several minor adjustments in some of the other items.

Tue 14-Apr-92: I have updated my collection of useful batch files
and tricks making it garbo.uwasa.fi:/pc/ts/tsbat35.zip.
   Sometimes there are situations where a batch file needs to call
another in order to perform its task. There is a genuinely clever
trick in Wolverton & Gooking, Supercharging MsDos, Microsoft Press,
1991, p. 102 to circumvent the need of having a separate batch by
making a batch call itself. I have modified the solution a bit and
rewritten my SAFEDEL.BAT (safe delete of files) so that it no longer
needs the auxiliary SAFEDEL1.BAT batch.
   Likewise the SHOW.BAT (wildcard multi-file type command) has been
updated and the auxiliary file SHOW1.BAT has been deleted.
   The same book shows how to push the current directory without the
need of resident programs, auxiliary executables, or environment
variables. On the other hand this is less general than my
PUSHDIRE.BAT which uses an auxiliary executable and environment
variables. PUSHIT.BAT based on the idea from Wolverton & Gooking
does not work between different drives.  I have added this file to
tsbat35.zip along with its auxiliary text file CD.AUX.

Sat 21-Mar-92: I have updated my collection of useful batch files
and tricks making it garbo.uwasa.fi:/pc/ts/tsbat34.zip.
 - Added EXE2ZIP for converting self-extracting archives into
   zipped archives. Requires that you have PKZIP.EXE and dive R:
   available. I have ramdisk on drive R:, and if you do not you have
   to either customize the batch or use a suitable drive
   substitution like SUBST R: C:\
 - Updated REZIP.BAT which removes authenticity -AV labels for
   zipped archives. (Such a batch is useful, since PKWare's
   authenticity code was broken and some BBSes put in their own -AV
   labels). If errors are reported by pkzip, the user is asked for
   whether s/he wants to go on nevertheless.
 - Added a WILD.BAT to perform wildcarded operations with commands
   which ordinarily do not allow wildcards. Example of WILD.BAT
   usage: WILD *.txt type. The idea for my own version comes a from
   a note in a Finnish computer journal (Mikro PC, March 1992, Aimo
   Matikainen).

Sat 22-Feb-92: I have updated my collection of useful batch files
and tricks making it garbo.uwasa.fi:/pc/ts/tsbat33.zip.
 - Added PROMPT.TXT tips on prompt usages with ansi
 - Added REPLY.BAT to demonstrate how batch files can after all
   accept input without any auxiliary programs (like the common
   ask.exe). This is not a widely known trick, although I cannot
   claim true originality. It utilizes environment variables, and is
   somewhat awkward, but shows that it can be done.

Tue 4-Feb-92: I have again updated my collection of useful batch
files. It is now garbo.uwasa.fi:/pc/ts/tsbat32.zip. Some of the
batches do not allow wildcards in file names given to them as
parameters. There was a clever for-loop trick in the PC Magazine Vol
11 No 1 on page 364 to check whether the file name is wildcarded.
Even if innovative the PC Magazine's solution uses unnecessarily an
environment variable for the checking. But the article got me
thinking that I should find a better solution and put in a check for
wildcards to warn the user in those of my batches which do not allow
wildcards. Consequently I have updated the following batches in my
collection:
 ARC2ZIP.BAT     Single .arc to .zip with comment
 REZIP.BAT       Remove zip authenticity labels
 UNPACK.BAT      Unpack-test-view any archivetype
 ZOO2ZIPH.BAT    Single .zoo to .zip on harddisk

Sat 25-Jan-92: I have updated my collection of useful batch files.
It is now garbo.uwasa.fi:/pc/ts/tsbat31.zip and contains 49 batch
files. It adds
- boot.bat for convenient selective booting from alternative
  configurations. It is often believed that complicated programs are
  needed for booting with alternative configurations. The boot.bat
  batch shows that this need not be the case at all.
- path.txt to explain how to easily circumvent the 127 character
  limit on the path length.
- showtime.bat to show both the date and the time without the hassle
  of beating enter to death.
- mve.bat to move file(s) to another directory.

Sat 7-Dec-91: I have updated my collection of useful batch files. It
is now garbo.uwasa.fi:/pc/ts/tsbat30.zip.
   Alan Clark (clark@odie.ee.wits.ac.za) suggested that the screen
blanking batches could well do with a method to totally hide the
cursor while blanked. I have looked into this and noticed that this
can be easily achieved without extra programs by using ansi escape
sequences. BLK.BAT shows how to do it. (You'll have to activate
cursor hiding by editing three rems away).
   Added LC.BAT line count for text files.
   Added TEST33.BAT Test for MsDos 3.3 or later, batch demo

Sat 9-Nov-91: I have updated my collection of useful batch files to
be garbo.uwasa.fi:/pc/ts/tsbat29.arc. It includes PUSHDIRE.BAT,
SETPUSHD.EXE, and POPDIRE.BAT for pushing and popping the current
directory (utilizing environment variables).  I have added a /q
switch for quiet operation (no echoing of the environment variables)
at a suggestion from Doug Tooley, djtooley@lotus.uwaterloo.ca.
   I have added a TESTANSI.BAT batch (with accompanying ISANSI.EXE)
which can be used to test whether any ansi-type screen driver is
installed and thus available.
   There are also some minor adjustments in a couple of the old
batches.
   Get this package even if you do not need the individual batches.
There is much to learn from them about MsDos and batch usages. Many
Frequently Asked Questions (FAQs) are implicitly answered by looking
at these files.

Sun 20-Oct-91: I have a collection of useful batch files which I
have updated to be garbo.uwasa.fi:/pc/ts/tsbat28.arc.
  I have added a LEVEL.BAT testbench batch for testing the error
level returned by programs.
  I have updated the ASK.EXE batch file enhancer. It now has the
option to of returning with a timeout errorlevel. The usage of
this enhancer is:
 ASK [Prompt] [/b] [/d] [/l] [/t##] [/u]
                !    !    !    !      +- convert to Upper case
                !    !    !    +- Time-out parameter (0 = forever)
                !    !    +- convert to Lower case
                !    +- Direct read (no <-+ needed)
                +- Batch mode (needed only if no prompt)
   I have added an ASKENV.EXE batch file enhancer to the collection.
It is similar to ASK.EXE, but instead of returning an errorlevel
value, it sets the (parent's) environment variable ASKENV value
equal to the user's response.

Mon 9-Sep-91: I have updated my collection of useful batch files. It
is now /pc/ts/tsbat27.arc.
   Four of the batches in the package has been updated. Of these
DAILY.BAT for running a program no more than one a day (eg from
autoexec.bat) utilized ENTER.TXT to simulate pressing the enter key.
This is no longer necessary but has been rewritten (with a trick
with the echo command) in a way that no longer needs this separate
file. My thanks to Ran Cheremsh CHERMESH%BGUVM.BITNET for reporting
the problem.
   SCANZ for scanning .ZIP files for viruses had a bug in the
routine for scanning embedded .ZIPs.

Tue 9-Jul-91: I have updated my collection of useful batch files. It
is now /pc/ts/tsbat26.arc.
   Note that even if you don't perhaps need the same batches as I
do, these batches may teach you many useful batch programming
tricks which I have accumulated during my PC years.
   Made a number of minor stylistic corrections.
   Since someone cracked the pkzip 1.10 authenticity (-av) code some
BBSes have been putting in their own ads as the authenticity labels.
A new batch rezip.bat removes these labels, which may give the users
a false sense of security.
   Added a simple batch ruler.bat which shows the screen columns
using ansi codes to avoid excessive scrolling.
   I have my ramdisk on currently on drive R on my PCs which I use
at home and at office.  For whatever it is worth I have updated the
batches to reflect this change. Some of the batches require anyway
that you edit the paths in them to reflect yours, so no added
problem arise because of this.  And, if you have your own ramdisk,
say, on d:, you can put the statement subst r: d:\ eg in your
autoexec.bat file to avoid the need of editing just because we may
happen to have ramdisks on different drives. (To be accurate there
is no absolute need of your d: physically being a ramdisk. But it
makes things a bit faster.)

Sun 12-May-91: I have updated my collection of useful batch files to
be /pc/ts/tsbat25.arc.
   One of the constant worries of downloaders of archived packages
is the threat of viruses. (Games from shady BBSes are particularly
susceptible, but even commercial products have been known to be
infected). Fortunately there are good virus checkers like McAfee's
/pc/virus/scanv77.zip and Fridrik Skulason's /pc/virus/fp-115a.zip
available to check for infections. There are, however, two dilemmas
in checking archived packages on a routine basis. (Since the format
garbo.uwasa.fi archives mostly uses is .zip let's speak of zipped
files). The first problem is that there are so many executable
compressors in use currently (such as lzexe, pklite, diet, tinyprog,
etc). This means that unless the virus checking programs can observe
all these variations, a virus can be hiding in an execompressed
form. Therefore it is advisable to expand the executables for the
check. A second problem is that .zip files occasionally contain
embedded .zip files (eg PC-Magazine's collections often do). These
embedded .zip files must be unzipped for a closer examination.
   The earlier versions of the tsbat collection included a batch
called scanzip.bat. I have completely rewritten this batch to take
care of the two eventualities discussed above. I have renamed the
rewritten batch scanz.bat. Note that before using this new batch,
you have to go through scanz.bat and edit all the directory path
references to correspond to your own configuration. This is, of
course, an inconvenience, but it is the best way of guaranteeing
that a batch complicated as this stays reasonably efficient.

Wed 13-Mar-91: I have written a menu based ansi.sys driven advanced
batch for sending command codes to the printer to make printer
initialization and setting easy. It is called setprn.bat. It is for
Diconix Inkjet Parallel Printer Model 150, which is an Espon
compatible printer. Thus the batch is suitable for various different
printer makes, and easily configurable. I have added this batch to
my collection of (hopefully) useful and instructive batch files
/pc/ts/tsbat24.arc best available by anonymous ftp from
garbo.uwasa.fi archives. There is a program-based alternative to
setprn.bat, that is setdico.exe which can be found in
/pc/ts/tsprn##.arc. The difference is that in setprn.bat you are
able to configure the printer codes if you wish.

Sat 29-Dec-90: I have programmed a fair number of MsDos batch files
to make up a batch file collection of hopefully both useful and
instructive batches. I have updated the collection to be version
/pc/ts/tsbat23.arc by adding some new batches.
...
   FU.BAT is a poor man's function evaluator utilizing gwbasic that
(usually) belongs automatically to the MsDos delivery. The basic
idea (pardon the pun) of combining batch and gwbasic programming is
not really mine. I got it from the PC-Magazine. The code of this
batch, however, is entirely due to yours truly.
...
   ASK.EXE is a common batch file enhancer returning as errorlevel
the ascii value of the first character of the user's response.
An example of a simple batch utilizing ASK:
    echo off
    ASK Yes or no? /d /u
    if errorlevel==89 if not errorlevel==90 echo It was a yes
    if errorlevel==78 if not errorlevel==79 echo It was a no
    echo on
My ask has switches for lower case (/l) and upper case (/u)
conversions, and (/d) "direct" reads without needing to press the
enter key. The ask prompt may include escape sequences for ansi
graphics. This is a feature not always available in other ask
programs.
   Ok, there are countless ask batch enhancers already around, so
why yet another. Simply so that then tsbat23.arc has it, and you
don't have to get one separately. Furthermore, this ask is both
simple and general enough to be easy to use while being still
flexible.
   BTW, ask is the one command which the original MsDos batch
programming most conspicuously lacks and needs. So many other
seemingly lacking features are embedded in MsDos, and you just have
to ferret them out. That's partly what tsbat23.arc collection is
about.
...
   SAFEDEL.BAT is a generalized batch for deleting files. It asks
for confirmation for each file to be deleted. The usage is
        SAFEDEL [FileName1] [FileNam2] ...
and wildcards are allowed.
...
   MENU.BAT show show to build menus for easy program selection by
the user. This batch utilizes ask.exe, and is livened up by ansi
graphics.
...
   UNPACK.BAT has been updated. It extracts, tests, and views packed
files (archives) irrespective of the packing method. The update
handles also .arj files (the new arrival sent packing on the scene).

Mon 22-Oct-90: I have updated my batch file collection to be
/pc/ts/tsbat22.arc. PC-Magazine Vol 9 Num 14 published a batch to
com file compiler bat2exec.com by Douglas Boling which is in the
/pc/pd2/bat2ex13.zip package at chyde.uwasa.fi archives. As would be
expected a batch compiler is more stringent in its requirements than
MsDos. Consequently I have gone through the batches in my collection
and seen to it that they are compilable. Note that in doing this I
have not altered the tasks of the batch files, nor have I included
the resultant compiled .com files. Where needed, I have just
adjusted the batches to conform with bat2exec.com compiler
requirements.
   Among others there is an addpath.bat batch for adding directories
to the path without needing to rewrite the whole path as the
ordinary path command would require. In a similar manner there is
delpath.bat to omit a single directory from the path. Delpath.bat
needs an auxiliary batch file called setvar.bat, which must be
available to the delpath.bat. Delpath now checks whether the
auxiliary setvar.bat file is available in the current directory or
at path before running the rest of delpath.bat.
   When a batch contains a call to a program, the program must
either be in the current directory, at path, or the call must
contain the path to the program. The last method has the
disadvantage of requiring adaptation to user's own structure.
Therefore the most general method is having the necessary program(s)
at path. If the program is not available, a normal batch ends in a
"Bad command or file name" error message. This gives very little
information of the cause of the problem. Therefore I have added
routines in the batches to precheck that the required program(s) are
indeed at path, and if not, issue a proper error message telling
what exactly is awry. (The batch trick here is testing whether a
given file is at path.)
   An additional note. Batches like delpath.bat cannot obviously be
compiled successfully with bat2exec because of its need of an
auxiliary batch. Another batch that works as a normal batch file,
but won't work when compiled is color.bat. Color.bat sets the screen
color attributes using ansi code. Bat2exec.exe compiler has similar
problems with some other batches as well, but this does not affect
the user of these batch files in any way.
   I have added blk.bat as an alternative simple screen saver to
complement blank.bat. Blk.bat stores the screen before blanking and
pops it when you exit the saver.

Fri 13-Jul-90:  One of the operators at our computer centre asked me
today whether I know a replacement utility for MsDos diskcopy to
copy a 1.2Mb floppy to another without having to change the disks
more than once. This is because MsDos diskcopy.com requires a total
of five disk changes in the process, and besides this being tedious
one easily gets things mixed up. If you look at things this way,
scopy.bat in /pc/ts/tsbat21.arc does exactly what he was asking for,
in a single step. But on the balance, you must have the target disk
formatted before you begin the process (diskcopy does that for you,
if necessary). This batch method works easily, though, only if the
diskette to be copied has no subdirectories.

Sun 24-Jun-90: I have updated my batch file collection to be
(/pc/ts)/tsbat21.arc. This time I have added my rendition of setting
the screen text color and background. The color.bat batch uses ansi
color codes. (Thus you must have loaded ansi.sys driver, or its
enhanced equivalent (such as nansi.sys or zansi.sys). In other words
your config.sys must have a line like device=\sys\zansi.sys in it).
   Version tsbat20 introduced a scanzip.bat batch as a shell to scan
.zip packages for viruses utilizing McAfee's scan.exe virus checker.
In addition to unzipping the .zip files into a temporary directory
the batch uncompressed lzexec .exe files, if any, using Alan
Posner's (/pc/pd2) isl12.zip and Mitugu Kuriziono's
(/pc/pd2/)unlzexe5.zip. With the introduction of version
(/pc/virus/)scanv63.zip uncompression lzexed executables is no
longer necessary, and I have adjusted the batch accordingly. I have,
however, done this by just commenting away parts of the batch, so
that you can still apply it if you have earlier than scan.exe
version 63. I have also added checking overlay files in addition to
.exe and .com files.
   Please note that your email comments, feedback and suggestions on
the ts-programs would be welcome. And if you want to look at other
users' feedback, you can see it by getting /pc/pd2/post##.txt (## =
01, 02, and so on).

Thu 7-Jun-90: Lzexed files pose a problem for the present virus
scanners. While waiting to see the announced scanv63 to appear with
abilities to scan lzexe-compressed files, I wrote a batch to handle
scanning .zip packages. This batch checks both ordinary and lzexed
files within a .zip package. The following shareware and PD programs
are needed: pkunzip.exe, scan.exe, islzexe.exe, unlzexe.exe, The
packages containing these programs can be found from good BBSes and
eg from chyde.uwasa.fi by anonymous ftp. The new batch scanzip.bat
is included in the updated /pc/ts/tsbat20.arc batch file collection.

Fri 1-Jun-90: Released version /pc/ts/tsbat19.arc of my batch files
collection. It includes two new batches. There is a poor man's
screen save blank.bat, and there is an extension of the MsDos type
command show.bat, which allows the usage of wildcards and multiple
file names. You'll decide yourself if there is any usage for a
wildcard type. Myself, I do not see any outright, but the batch
itself is a very good exercise in batch programming. If you are new
to this aspect of MsDos, I think you will learn many useful tricks
from batches like this. - Where possible, I have tried to write the
batches in a way that they need a minimum about of auxiliary files
or such auxiliary programs, which are not part of MsDos (internal or
external) commands. - I have rewritten lastboot.bat (recording the
previous boot time of your PC) and logrun.bat (recording program
usage) so that they no longer need the auxiliary files enter.txt and
star.txt, which have been deleted from the new version. - There are
some stylistic changes in scopy.bat.

Sat 17-Mar-90: Released a new version /pc/ts/tsbat18.arc of my batch
files collection. - It seems that this batch collection has become
perhaps the most popular of my packages judging from the recent
download figures and the comments from users. (A note written later:
The most downloaded package of mine is the Frequently Asked
Questions /pc/ts/tsfaq##.arc, by a broad margin). - Corrected a
small bug in c.bat that prevented going back to the root directory.
- Built a simple batch lastboot.bat for displaying the date and time
of the previous booting. - Also built a new batch virus.bat. This
batch makes a directory both prior and after running the suspect
program, and gives a warning if the directories differ, and prepares
a list of the differences. The batch can be also used by a
knowledgeable user for the more benevolent similar purpose of
checking what files a certain programs changes.
   *Flame off* One lesson to be learned from batch programming is
that properly used MsDos can be quite flexible. I think it is here
to stay for a long time yet Unix and OS/2 notwithstanding. And this
does not mean castigating Unix nor OS/2. (Any discussion of this
aspect to the proper newsgroups, if you please.) *Flame on* :-)

Sun 11-Mar-90: Released a new version /pc/ts/tsbat17.arc of my batch
files collection. This update introduces a batch shell unpack.bat
for extracting, testing, and viewing packed files irrespective of
the packing method.

Sun 04-Mar-90: My batch file collection is now version (/pc/ts/)
tsbat16.arc. - Addpath.bat appending new directories to the path now
checks whether the directory exists, and whether the directory
already is at path, thus preventing mistakes by the user. I use this
batch myself a lot, and since I often make typing errors, I wanted
the batch to do the validity checking for me. - Arc2zip.bat
converting an .arc file to a .zip file, with comment, has added
safeguards against errors and corrupted archives. - Deldir.bat for
deleting the files from a directory and then removing the directory,
has been rewritten. - There are also new batches in the collection.
- There is a harddisk version of the packing methods converter
called zoo2arch.bat. It is a .zoo to .zip converter eg for those who
prefer tighter .zip files over the binary posting's current .zoo
packing method. - If you have been annoyed by the fact that MsDos
cannot take more than one command per command line, m.bat is the
batch for you. It is a batch that facilitates giving multiple MsDos
commands. Another new batch is d.bat. It gives the directory with
sort and generalized name matching. - Also managed to resist the
temptation to rename the documentation to the obvious bat.man.

Thu 25-Jan-90: I have updated my batch file collection to be version
(/pc/ts/)tsbat15.arc.  There is just one addition, daily.bat. It is
intended to run a program from the autoexec.bat file only once in a
day.  There are programs in circulation, which achieve the same
thing as daily.bat.  The trick in daily.bat is that it is a true
batch file without the need of any external user-made programs.
This not a very difficult to do, but tricky enough to be
interesting and educational.

Tue 16-Jan-90: I have still been thinking about batch files and
interesting tricks to do with them, and I therefore publish a new
upgrade of my botch :-) collection in a rapid succession after the
last update. The upgrade is (/pc/ts/)tsbat14.arc, and it will be
available by anonymous ftp at least from chyde.uwasa.fi, Simtel20,
and by BBS download or file request from Micro Maniacs Opus 2:515/1
telephone 358-0-425966. Two new utilities are included. The first is
delpath.bat, which removes a directory from the path variable. This
was a really tricky one, and my solution (contrary to the other
batches in the collection) requires MsDos version 3.30 because it
uses the call command. I have since seen another solution in the
PC-Magazine (Vol 8 No 21) but mine uses a somewhat different
technique, and should be clearer because even I can understand how
mine works :-). The second new batch is deldir.bat for deleting the
files from a directory and then removing the directory. This is
really trivial, but I needed it myself. I have tried to include
reasonable number of safeguards within this batch.

Sun 14-Jan-90: I have updated my batch file collection to be version
(/pc/ts/)tsbat13.arc.
   There is a new batch arc2zip.bat for converting an .arc file to a
corresponding .zip file. The batch automatically adds your zip-file
comment to the converted .zip. Also, the date of the zip file is
automatically set to the date of the latest file within the .zip,
not the date of the conversion.
   Another new batch is zipdate. It demonstrates how to datestamp
.zip packages.
   The new version also includes a second addpath utility. It is
apath-om.bat and is by Otto Makela. It is included in my batch file
collection with Otto's explicit permission. Thanks Otto. This batch
nicely demonstrates testing a condition (is a directory already in
the path) in MsDos batch programming. I had an interesting time
testing Otto's batch and discussing the dilemmas in the earlier
versions after Otto posted the original version in the news in
alt.msdos.programmer. I think that we both gained in the process. I
would pleased to consider similar useful contributions from other
users, as well. If you are interested, contact me by email.
   Where.bat has been rewritten. It finds a file by using a search
string on the file name. Contrary to the ordinary wildcarded MsDos
DIR-type convention, where.bat matches the search string anywhere
within the body of the file name. The updated where.bat has been
made case-insensitive (applies upper case conversion on batch
parameters).
   Some of the other batches in the package have had their help
texts extended.

Sat 18-Nov-89: There are several nice memory resident push/pop
directory utilities around. As you know pushdir stores the name of
the directory where you are. You can then change the directory (and
the drive) as much as you like, and popdir takes you right back to
the original directory. But memory resident programs tend to pile
up, and I started thinking whether push/pop can be achieved using
non-resident batch methods. PUSHDIRE.BAT and POPDIRE.BAT together
with SETPUSHD.EXE do this by juggling the environment variables. I
pushed these files in my batch file collection and updated it to be
tsbat12.arc. You can pop them from there.

Tue 31-Oct-89: Released update /pc/ts/tsbat11.arc of my batch files
collection. The new release introduces LOGRUN.BAT. It can be used
for calling programs and logging the call in a usage log with
time/date information. The batch utilizes MsDos time and date
commands for making the usage log of the program calls. The bug
caused by the non-standard switch /i in the file finder WHERE.BAT
has been amended. A new batch LOCATE.BAT for locating a file (or
files) on a disk has been added. Contrary to WHERE.BAT it is not
case sensitive. The "change the directory" batch has been renamed
C.BAT (was SD.BAT). I have also added more comments within some of
the batches.
  If you get an "Out of environment space" message in these, or any
other batches, try increasing your environment space by using shell
configuration in config.sys:
     Example: shell=c:\bin\command.com c:\bin /e:1024 /p

Sun 29-Oct-89: I decided to introduce a batch file collection
/pc/ts/tsbat10.arc.  The batches are quite straightforward, and do
not need any special auxiliary programs, just the ordinary MsDos
commands.  Some of the batches are from my other utility packages,
some are new.  I do not claim a high degree of originality.  This is
because the methods and tasks of batch programming keep repeating
over and over again.  But I hope that you will find some of my
tricks useful.
  And if you feel that you have useful batches yourself, which you
would like to distribute to your fellow users, I would be interested
in considering any good ideas for development.  Due credit would
naturally be given.  I would, however, reserve the right to choose,
and to develop your batches to suit the future versions of this
Public Domain collection.

Thu 26-Oct-89: I have a private mailing list for emailing these
update news. Especially, if you have my programs downloadable at
your site or your BBS you are welcome to ask for inclusion on this
list by emailing to me at ts@uwasa.fi. (This list no more exists.)
