 Area: Batch Language Programming                     FI 
  Msg#: 202                                          Date: 15 Jul 94  21:50:00
  From: Bob Stephan                                  Read: Yes    Replied: No
    To: Aline Dowd                                   Mark:
  Subj: Dr Dos And Debug      1/3

In a message dated 07-09-94, Aline Dowd said to Bruce Wilson:

 > It's been a long time, but there's been a patch posted here in the
 > past which will cause MS-DOS' Debug not to care which version of DOS
 > is in use and make it compatible with DR DOS.
AD>Thanks Bruce.  I must have missed it.  Maybe someone will re-post it
AD>some time.
Subj: Patching DOS executables to run with DR DOS--part 1 of 3

There is nothing mysterious about patching an executable file like
DEBUG although it may look somewhat cryptic.  All executable files
contain machine language instructions for the Intel CPU chips.  It is
simply a matter of finding the right instruction, in this case the
one that checks for the DOS version, and change it in some way so
that it works differently.  DEBUG and SID were designed to make it
easier to do exactly that, so we might as well use them.

There are many different ways to patch the various DOS versions of
DEBUG.  We will present several examples, but by no means every
possible way, nor for every possible version of DEBUG.  The idea is
to illustrate the general principal so that you can apply it to
whichever version of DOS and DEBUG you happen to have.  Although you
may be using DR DOS now, chances are that you previously used some
version of MS or PC DOS and might still be able to boot it from a
floppy.  In that case you might want to just use DEBUG to patch DEBUG
itself.  In other cases you might prefer to copy DEBUG to your DR DOS
operating system and use SID.  Examples of both procedures will be
given.  These procedures will also work with other DOS command files
such as EDLIN.  The MS DOS 5.0 version of EDLIN will not work
properly after being patched, but earlier versions of EDLIN will.

NB: Before we start, note that if you have a copy of DEBUG from DOS
version 3.31 (e.g. COMPAQ DOS) that it will work with DR DOS
unchanged.  In that case you don't have to read any further.

EXAMPLE 1.  This first example was suggested by Brett Glass in Info
World, June 24, 1991, page 110, and it applies to MS-DOS 3.3 or IBM
PC-DOS 3.3 as the current (booted) operating system.  COPY DEBUG.COM
to a new file with a name like DRDEBUG.COM, and invoke DEBUG on the
copy.  In the examples the > represents the DOS prompt:

  >COPY DEBUG.COM DRDEBUG.COM
  >DEBUG DRDEBUG.COM

(NOTE: if your version of DEBUG is DEBUG.EXE instead of DEBUG.COM you
must still copy it with the .COM extension; i.e. COPY DEBUG.EXE
~DRDEBUG.COM.   Do not use DEBUG on a file with a .EXE extension.  It
does not work the same way, but when you copy it to your DR DOS
system you can again give it its proper .EXE extension.)

Use the DEBUG S command (for Search) to find the code you want to
change by entering the following command (Note: - is the DEBUG prompt
you will see on the screen.  Do not type the -).

 -S 100 L 1000 3D 03 1E

If all is as expected, DEBUG will respond with an address such as
2360:069F.  Make a note of the second set of 4 characters
(hexadecimal digits after the colon). This is the address of the code
you need to change.  If nothing is returned, or if more than one
address is shown, read some of the other examples below for other
methods to try.

Next, enter the DEBUG command:
 -E 069F 3D 03 1F

Note that if the 4 digits that you wrote down are not 069F you must
substitute your address where you see 069F.  Note also, some versions
of DEBUG prefer not to have a space after the command.  If you get an
error when entering any of these DEBUG commands, change them to
eliminate the space.  In that case the above example would be typed
as:

-E069F 3D 03 1F

Essentially what this does is change the check for DOS 3.30 to a
check for DOS 3.31 which is what DR DOS reports itself as being.
This is all that is necessary to change the code to work with DR DOS,
so you can now save the modified file and exit with the following two
commands:

 -W
 -Q

Finally, back at the DOS prompt, copy DRDEBUG.COM to your DR DOS
system as DEBUG.COM and you will have a version of DEBUG that you can
use with DR DOS.

(Continued)

.. Team GET * bob.stephan@nitelog.com * CI$:72357,2276 * FIDO:1:216/303
-- MR/2

-!- QScan v1.065b
 ! Origin: Nitelog BBS Monterey CA (408) 655-1096 (1:216/303) (1:216/303)


 Area: Batch Language Programming                     FI 
  Msg#: 203                                          Date: 15 Jul 94  21:50:00
  From: Bob Stephan                                  Read: Yes    Replied: No
    To: Aline Dowd                                   Mark:
  Subj: Dr Dos And Debug      2/3

Subj: Patching DOS executables to run with DR DOS--part 2 of 3

The foregoing procedure should work with other versions of DOS by
modifying the S command string to Search for the appropriate
sequence.  If you can find a single occurrence of the appropriate
sequence in your version of DOS, you can use the same E command,
modified of course to use the address reported by the S command.
CAUTION: if your version of DEBUG is DEBUG.EXE instead of DEBUG.COM
you must still copy it with the .COM extension; i.e. COPY DEBUG.EXE
~DRDEBUG.COM.  Do not use DEBUG on a file with a .EXE extension.  It
does not work the same way, but when you copy it to your DR DOS
system you can again give it its proper .EXE extension.

Here are the strings to try for other versions of DOS.  You can use
the VER command to find which version of DOS you are using.  These
have not all been tested by me, but they should work.

  DOS 3.0:  -S 100 L 1000 3D 03 00
  DOS 3.1:  -S 100 L 1000 3D 03 0A
  DOS 3.2:  -S 100 L 1000 3D 03 14
  DOS 3.31:  DEBUG should work as is.
  DOS 4.0:  -S 100 L 1000 3D 04 00
  DOS 4.01: -S 100 L 1000 3D 04 01
  DOS 5.0:  -S 100 L 1000 3D 05 00

EXAMPLE 2. In this example we will look more closely at the Intel CPU
code itself.  If none of the above examples work, you may still be
able to make the changes you need by examining the code.  This
example uses DEBUG.EXE from MS DOS 5.0.

First, copy DEBUG.EXE to give it a different name and extension, then
invoke DEBUG on it.  For example:

  >COPY DEBUG.EXE DRDEBUG.BIN
  >DEBUG DRDEBUG.BIN

This time we will search for a sequence that might work with any
version of DOS with the command:

  -S 100 l 1000 B4 30 CD 21

If DEBUG responds with a single address such as 1337:29A8, we can
examine the code at that address with the U (for Unassemble) command,
again using the second set of 4 digits:

  -U 29A8

You will then see a display of the code at that address similar to
the following:

1337:29A8  B430		MOV     AH,30
1337:29AA  CD21 	INT     21
1337:29AC  3D0500  	CMP     AX,0005
1337:29AF  7503		JNZ     29B4
     . . .

To reconcile this procedure with the one in Example 1, compare the
code at 1337:29AC with the DOS 5.0 S command above and note the same
3D 05 00 sequence.  At this point we can either change the CMP
instruction, 3D0500, or the JNZ instruction, 7503.  In Example 1 we
changed the CMP instruction.  CMP stands for compare, and it compares
the version reported by DOS with the version coded into DEBUG.  In
Example 1 we change the CMP instruction to compare the reported
version with 3.31 which is what DR DOS reports itself as.  The same
command, adjusted for the proper address, should work here too.

Alternatively, we can change the JNZ instruction.  JNZ jumps to the
DEBUG exit point if the previous comparison fails, so if we eliminate
the JNZ instruction, the jump will never take place.  The advantage
is that DEBUG will continue to work even if some future version of DR
DOS reports itself as something other than version 3.31.  A simple
way to eliminate this instruction is to change it to one or more "do
nothing"  instructions.  The Intel "do nothing" CPU instruction is
called NOP, for NO OPeration, and is represented by the code 90.  So
in this case we can use the command:

  -E 29AF 90 90

Then if we again use the Unassemble comand we will see:

1337:29A8  B430		MOV     AH,30
1337:29AA  CD21		INT     21
1337:29AC  3D0500 	CMP     AX,0005
1337:29AF  90   	NOP
1337:29B0  90 		NOP
     . . .

Now we can enter the W and Q commands to Write the file back to disk,
Quit (exit to the DOS prompt), and proceed as in Example 1.

(Continued)

.. Team GET * bob.stephan@nitelog.com * CI$:72357,2276 * FIDO:1:216/303
-- MR/2

-!- QScan v1.065b
 ! Origin: Nitelog BBS Monterey CA (408) 655-1096 (1:216/303) (1:216/303)


 Area: Batch Language Programming                     FI 
  Msg#: 204                                          Date: 15 Jul 94  21:50:00
  From: Bob Stephan                                  Read: Yes    Replied: No
    To: Aline Dowd                                   Mark:
  Subj: Dr Dos And Debug      3/3

Subj: Patching DOS executables to run with DR DOS--part 3 of 3

EXAMPLE 3. In this example we will use DR DOS SID to illustrate how
to do the same things as in Examples 1 and 2.  This will be useful if
you have a copy of a DEBUG file, but cannot boot a version of DOS
other than DR DOS.

This is an actual capture file from the SID session used to modify MS
DOS 5.0 DEBUG.EXE using essentially the same procedure as Example 2.
The following commands were used:

  >COPY DEBUG.EXE DRDEBUG.COM
  >SID DRDEBUG.COM

This invoked SID for the following session.  The comments to the
right of the semi-colons were added later to explain what is
happening.  SID uses the # sign for its prompt.  The commands you
enter are shown starting with lower case letters immediately
following the # signs; for example, l29a8 is lower case L29A8.  Note
also the values to enter after the #s29af command, and the single
period to indicate that there are no more values.  See the DR DOS
manual for explanations of these SID commands.

--------------------------------------------------
*** Symbolic Instruction Debugger ***  Release 3.2
      Copyright (c) 1983,1984,1985,1988,1990,1991
    Digital Research, Inc. All Rights Reserved
--------------------------------------------------

  Start      End		; Note these values
1058:0100 1058:5199		; for later use.
#sr0100,5000,b4,30,cd,21	; Search reports the
1058:29A8			; address to use.
#l29a8				; Unassemble -
  1058:29A8 MOV    AH,30	; SID uses
  1058:29AA INT    21		; L for List
  1058:29AC CMP    AX,0005
  1058:29AF JNZ    29B4
  1058:29B1 CLC
  1058:29B2 JMPS   29CC
  1058:29B4 CMP    AX,0002
        . . .       		; More shown
#s29af				; Set values
1058:29AF 75 90			; Enter 90
1058:29B0 03 90			; Enter 90
1058:29B1 F8 .			; Enter .
#l29a8				; Unassemble
  1058:29A8 MOV    AH,30
  1058:29AA INT    21
  1058:29AC CMP    AX,0005
  1058:29AF NOP
  1058:29B0 NOP
  1058:29B1 CLC
  1058:29B2 JMPS   29CC
  1058:29B4 CMP    AX,0002
        . . .       		; More shown
#wdrdebug.com,100,5199		; Write
#q				; Quit

This replaced the JNZ command with two NOP's as in Example 2, but
used the SID commands to do it.  Note that the Start and End values
reported by SID initially had to be used at the end with the W
command, so jot them down when SID starts up.  If you do not use the
.COM extension as in DRDEBUG.COM, the address values will be
different from those shown here.
---------------------------------------
Good luck.

.. Team GET * bob.stephan@nitelog.com * CI$:72357,2276 * FIDO:1:216/303
-- MR/2

-!- QScan v1.065b
 ! Origin: Nitelog BBS Monterey CA (408) 655-1096 (1:216/303) (1:216/303)


 Area: Batch Language Programming                     FI 
  Msg#: 192                                          Date: 31 Jul 94  16:09:00
  From: Charles Anderson                             Read: Yes    Replied: No
    To: Lee Gunter                                   Mark:
  Subj: Re: Drive A: Vs. Drive B:

And thus spouted Lee Gunter to All about Drive A: vs. Drive B:
 LG> I am having a problem with MS-DOS 6.0. Not the DOS itself, but making
 LG> my upgrade from 5.xx. The stupid upgrade (in fact, it's a self
 LG> contained pkg, not an upgrade) keeps telling me I MUST have the
 LG> floppies in drive A:, but the disks are 1.44's and my A: drive is a
 LG> 1.2. My B: is the 1.44. Can a batch file be created to handle this?
 LG> Can anything be done to handle this. So far all I know of that will

======================================================================
  Microsoft(R) Product Support Services Application Note (Text File)
                PD0473: INSTALLING MS-DOS FROM DRIVE B
======================================================================
                                                   Revision Date: 4/93
                                                      No Disk Included

The following information applies to Microsoft MS-DOS 5.0 Upgrade, 6.0
Upgrade.

 --------------------------------------------------------------------
| INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY    |
| ACCOMPANY THIS DOCUMENT (collectively referred to as an            |
| Application Note) IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY      |
| KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO    |
| THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A     |
| PARTICULAR PURPOSE. The user assumes the entire risk as to the     |
| accuracy and the use of this Application Note. This Application    |
| Note may be copied and distributed subject to the following        |
| conditions: 1) All text must be copied without modification and    |
| all pages must be included; 2) If software is included, all files  |
| on the disk(s) must be copied without modification [the MS-DOS(R)  |
| utility DISKCOPY is appropriate for this purpose]; 3) All          |
| components of this Application Note must be distributed together;  |
| and 4) This Application Note may not be distributed for profit.    |
|                                                                    |
| Copyright 1991-1993 Microsoft Corporation. All Rights Reserved.    |
| Microsoft and MS-DOS are registered trademarks and Windows         |
| is a trademark of Microsoft Corporation.                           |
 --------------------------------------------------------------------

You can use drive B instead of drive A to install Microsoft MS-DOS 5
Upgrade and MS-DOS 6 Upgrade. For this setup procedure, you need your
MS-DOS 5 Upgrade or MS-DOS 6 Upgrade disks and one or two blank disks.
The blank disk(s) you supply should be unformatted or newly formatted.

   NOTE: If you are upgrading a version of MS-DOS earlier than version
   3.0, you must use drive A to run Setup.

TO INSTALL THE MS-DOS 5 UPGRADE OR MS-DOS 6 UPGRADE FROM DRIVE B
----------------------------------------------------------------

1. Start your computer with your current version of MS-DOS.

2. If you are installing MS-DOS 5 Upgrade, insert Disk 1 from your MS-
   DOS 5 Upgrade package in drive B. If you are installing MS-DOS 6
   Upgrade, insert Disk 1 from your MS-DOS 6 Upgrade package in drive
   B.

3. Type "b:setup" (without the quotation marks) and follow the
   instructions on your screen.

4. Setup asks you to insert the Uninstall disk(s), which is the blank
   unformatted or newly formatted disk you supply. Insert this disk in
   drive A.

   Setup cannot continue unless you insert a blank or newly formatted
   disk in drive A. You must use drive A because Setup copies files
   onto the Uninstall disk(s) that MS-DOS needs to start your computer
   if you ever decide to restore your earlier version of MS-DOS.


RELATED INFORMATION
-------------------

For more information about the MS-DOS Setup program, see Chapter 2 of
the "Microsoft MS-DOS Getting Started" guide for MS-DOS 5 Upgrade or
see MS-DOS Help for MS-DOS 6 Upgrade (type "help" [without the
quotation marks] at the MS-DOS command prompt and press ENTER).

For more information about the Uninstall disk, see Chapter 2 of the
"Microsoft MS-DOS Getting Started" guide for MS-DOS 5 Upgrade or see
MS-DOS Help for MS-DOS 6 Upgrade (type "help" [without the quotation
marks] at the MS-DOS command prompt and press ENTER).

... Floppy not responding.Format hard drive instead? (Y/N)_
___ Blue Wave/QWK v2.12

-!- QScan v1.066b
 ! Origin: Kids And Cops * Lynn, MA * (617) 599-2499 * (1:101/290)


 Area: Batch Language Programming                     FI 
  Msg#: 195                                          Date: 02 Aug 94  23:26:33
  From: Amer Neely                                   Read: Yes    Replied: No
    To: Mike Wells                                   Mark:
  Subj: Re: NUL

 -=> Quoting Mike Wells to All <=-

 MW> Hello All!

 MW> Is it okay to pipe output into NUL? eg.

 MW> c:\mouse\mouse.com >NUL

 MW> This is what have done, but with all this talk of small files, it's a
 MW> little bit of a worry now! Am I doing anything wrong?

This is perfectly OK. NUL is a reserved device name and is used as a
"black hole" to redirect unwanted output to, such as the informational
messages you get when certain utilities are run. Note however, that any
error messages that might have been displayed are no longer visible.

You can use NUL to check for the existence of directories too.

if exist c:\fubar\nul echo Yes, C:\FUBAR exists.
if not exist c:\fubar\nul echo C:\FUBAR doesn't exist.

This works because NUL _ALWAYS_ exists since it's part of resident DOS.
In order for the EXIST function to come back TRUE, the whole path must
exist. If any part of it doesn't exist, the return is FALSE. So, if you
want to know if a particular directory exists, just add \NUL to the end
of the path and EXIST will tell you.

Hope this helps.
-!-
Amer Neely
P.O. Box 1538 Stn. B
London  ON   CANADA   N6A 5M3
Internet: <aneely@publix.empath.on.ca> <aneely@suspects.com>
PGP fingerprint: 1D 0F D0 D1 D4 F7 76 9C  7E 93 46 A9 3B B2 93 73


-!- Blue Wave/Max v2.12 [NR]
 ! Origin: Five Guys BBS (1:221/1050)


 Area: Batch Language Programming                     FI 
  Msg#: 189             Rec'd                        Date: 03 Aug 94  01:05:00
  From: Keith Mcdermitt                              Read: Yes    Replied: No
    To: Bat Lang                                     Mark:
  Subj: Lesson #1 [was: Re: Start Lessons]

*** Quoting Bat Lang to Keith Mcdermitt dated 07-30-94 ***
> Keith, if I might make a suggestion for clarification for the entire
> echo?  Suggest that you change the header (as I have above).  Then all

 Good idea. So noted.

-!- GEcho 1.00
 ! Origin: Grand Central Networking, Holiday, FL. (1:3603/240)


 Area: Batch Language Programming                     FI 
  Msg#: 151             Rec'd                        Date: 05 Aug 94  10:43:16
  From: Gerry Pareja                                 Read: Yes    Replied: No
    To: Bat Lang                                     Mark:
  Subj: fancy batch (pushd/popd)

 Quoting BAT LANG | To: MICHAEL DEHLWES | Subj: fancy batch (pushd/popd)

BL>been using it ever since.  It will not work across drives, and there is

 The one below _does_ work across drives.

BL>an innocuous error msg at completion [Batch file missing], but this is a
BL>small price to pay for it's concise, hassle free operation.

BL>::PUSHD.BAT   ;copied shamelessly from this echo
BL>@If "%1"=="***" set prompt=$_@$N: $_@CD $P$_@DEL c:\popd.bat
BL>@If "%1"=="" %COMSPEC% /c %0 *** > C:\PopD.Bat

 @echo off
 :: HOME.BAT, By Vernon Frazee, Batpower echo, Implemented 14 Dec 93
 if "%1"=="" goto S
 for %%x in (s S r R) do if (%1)==(/%%x) goto %%x
 if "%1"=="/?" echo Syntax: [CALL] HOME.BAT [/S] [/R]
 goto END
 :S   (save current drive:\dir)
 echo @PROMPT CD $P$_$N:>%ram%\temppr.bat
 %comspec% /c %ram%\temppr.bat>%ram%\popdir.bat
 del %ram%\temppr.bat
 goto END
 :R   (return to saved drive:\dir)
 %ram%\popdir.bat
 :END

 where %ram% is the Ramdisk letter (and colon), G: in my case.

 How does it work?

 Well, try the above by removing the line that deletes TEMPPR.BAT, and
 look at that file.  Then, read up on the PROMPT command.  The "trick"
 is that since the operation takes place in a "shell" (that's the
 "%comspec% /c" line) you need not bother to save previous values
 (oldprompt) and reset them later.  Saves quite a few lines of code.

 Gerry


 * OLX 2.1 TD * G. Pareja * Vancouver * B.C. * Canada *

-!- Maximus 2.01wb
 ! Origin: VKUG/VPCC Batpower Echo - Richmond, BC (1:153/151)


 Area: Batch Language Programming                     FI 
  Msg#: 178                                          Date: 12 Aug 94  01:32:16
  From: Vernon Frazee                                Read: Yes    Replied: No
    To: All                                          Mark:
  Subj: Put DATE in evar

    Here's one BATch file solution for "How do I get the current system
    DATE into an environment variable?":

@echo off
:GET-DATE.BAT - Type "GET-DATE /?" (not the quotes) to view help. ------
 if (%1%2)==(dateis) goto GOTIT
 if (%1)==() goto BEGIN
:Syntax ----------------------------------------------------------------
 echo.
 echo     Name: GET-DATE.BAT
 echo.
 echo   Author: Vernon Frazee - 01/13/94
 echo.
 echo  Purpose: Sets environment variable DATE using current system date
 echo.
 echo           The DATE will always be in the form: MM-DD-YYYY
 echo.
 echo    Where: MM=Month, DD=Day, and YYYY=Year
 echo.
 echo   Syntax: [call] [d:][\path\]GET-DATE [/?]
 echo.
 echo    Notes: Requires 16 bytes free environment space.
 echo.
 goto END
:BEGIN -----------------------------------------------------------------
 set date=
 ver|date>temptemp.bat
 echo %0 %%1 %%2 %%4>current.bat
 temptemp
:GOTIT -----------------------------------------------------------------
 set date=%3
 echo.
 echo DATE=%date%
 echo.
:Cleanup ---------------------------------------------------------------
 for %%x in (temptemp current) do del %%x.bat
:End ------------------------------------------------------------- -vjf-

    Vernon.Frazee@f71.n135.z1.fidonet.org

 -- SPEED 1.40 #1680:

-!- Olms 1.60 [PRSBN46N]
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)


 Area: Batch Language Programming                     FI 
  Msg#: 177                                          Date: 12 Aug 94  01:32:15
  From: Vernon Frazee                                Read: Yes    Replied: No
    To: All                                          Mark:
  Subj: Put DAY in evar

    Here's one BATch file solution for "How do I get the current system
    DAY (Sun, Mon, Tue, ... Sat) into an environment variable?":

@echo off
:GET-DAY.BAT - Type "GET-DAY /?" (not the quotes) to view help. --------
 if (%1%2)==(dateis) goto GOTIT
 if (%1)==() goto BEGIN
:Syntax ----------------------------------------------------------------
 echo.
 echo     Name: GET-DAY.BAT
 echo.
 echo   Author: Vernon Frazee - 01/13/94
 echo.
 echo  Purpose: Sets environment variable DAY using current system date
 echo           DAY is always three alpha-characters: Sun, Mon, ... Sat
 echo           (First letter is always uppercase, last two lowercase)
 echo.
 echo   Syntax: [call] [d:][\path\]GET-DAY [/?]
 echo.
 echo    Notes: Requires 8 bytes free environment space.
 echo.
 goto END
:BEGIN -----------------------------------------------------------------
 set day=
 ver|date>temptemp.bat
 echo %0 %%1 %%2 %%3>current.bat
 temptemp
:GOTIT -----------------------------------------------------------------
 set day=%3
 echo.
 echo DAY=%day%
 echo.
:Cleanup ---------------------------------------------------------------
 for %%x in (temptemp current) do del %%x.bat
:End ------------------------------------------------------------- -vjf-

    Vernon.Frazee@f71.n135.z1.fidonet.org

 -- SPEED 1.40 #1680:

-!- Olms 1.60 [PRSBN46N]
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)


 Area: Batch Language Programming                     FI 
  Msg#: 179                                          Date: 12 Aug 94  01:32:17
  From: Vernon Frazee                                Read: Yes    Replied: No
    To: All                                          Mark:
  Subj: Put TIME in evar

    Here's one BATch file solution for "How do I get the current system
    TIME into an environment variable?":

@echo off
:GET-TIME.BAT - Type "GET-TIME /?" (not the quotes) to view help. ------
 if (%1%2)==(timeis) goto GOTIT
 if (%1)==() goto BEGIN
:Syntax ----------------------------------------------------------------
 echo.
 echo     Name: GET-TIME.BAT
 echo.
 echo   Author: Vernon Frazee - 01/13/94
 echo.
 echo  Purpose: Sets environment variable TIME using current system time
 echo.
 echo           The TIME will be in the form: HR:MN:SC.HN[a/p]
 echo.
 echo    Where: HR=Hour, MN=Minute, SC=Seconds, HN=100ths of a second,
 echo           and [a/p] means either an "a" or "p" (for AM or PM).
 echo           (If the hour is less than 10 it will be a single digit).
 echo.
 echo   Syntax: [call] [d:][\path\]GET-TIME [/?]
 echo.
 echo    Notes: Requires up to 16 bytes free environment space.
 echo.
 goto END
:BEGIN -----------------------------------------------------------------
 set time=
 ver|time>temptemp.bat
 echo %0 %%1 %%2 %%3>current.bat
 temptemp
:GOTIT -----------------------------------------------------------------
 set time=%3
 echo.
 echo TIME=%time%
 echo.
:Cleanup ---------------------------------------------------------------
 for %%x in (temptemp current) do del %%x.bat
:End ------------------------------------------------------------- -vjf-

    Vernon.Frazee@f71.n135.z1.fidonet.org

 -- SPEED 1.40 #1680:

-!- Olms 1.60 [PRSBN46N]
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)


 Area: Batch Language Programming                     FI 
  Msg#: 189                                          Date: 16 Aug 94  15:38:07
  From: Allen Cain                                   Read: Yes    Replied: No
    To: LARRY SMITH                                  Mark:
  Subj: Re: A install bat

 -=> Quoting LARRY SMITH to all <=-

 LS> Hello everyone!

 LS> I need a bat file that will install a program from a floppy.
 LS> We are tring to get new users for the local BBSs in my area.  Most of
 LS> the users we are going after are new to computers and like the "put
 LS> the disk in and type install" group.

 LS> So what we would like to do is have a bat file that will install
 LS> RipTerm to thier hard drive.  Even better would be a bat file for
 LS> windows.
 LS> We need it to look like this

 LS> install from   ? drive  or ? drive
 LS> install to ? drive

Okay, I hope this works:

---INSTALL.BAT---
@echo off
cls <-personal preference
if %1=="" goto err
if %2=="" goto err
%1
cd\
md ripterm
cd ripterm
md icons
md fonts
copy /v %2\riptm154.exe(riptm filename)
riptm154
move *.icn \icons
move *.rip \icons
move *.chr \fonts
cls
echo ****Installation of Ripterm 1.54 complete!!****
pause
ripterm
goto end

:err
echo Syntax:
echo INSTALL [source drive] [target drive]
echo Please try again...
goto end

:end



... Who me?  I think you have me confused with someone more civilized.
-!- GEcho 1.02+
 ! Origin: --=={{ The Eternal Flame }}==--  Chattanooga, TN (1:362/940)


 Area: Batch Language Programming                     FI 
  Msg#: 191                                          Date: 21 Aug 94  14:01:00
  From: John Evans                                   Read: Yes    Replied: No
    To: Phil Coakley                                 Mark:
  Subj: Removing x lines from a text file

Hello Phil,

Thursday August 18 1994 15:18, Phil Coakley wrote to All:

 PC> How (if it's possible) would I remove x lines from the top/bottom of a
 PC> text file through (duh) a batch file?

If you have EDLIN, here's an old batch that might help. Example usage:

 chop text.fil 5 0

will remove the top 5 lines from the file TEXT.FIL.

 chop text.fil 0 5

will remove the bottom 5 lines from TEXT.FIL.

 chop text.fil 3 15 new.fil

will remove the top 3 and bottom 15 lines and rename TEXT.FIL to NEW.FIL.

In all cases, the original file is retained as filename.BAK.

@echo off
if not %1 == /? goto errorcheck
echo ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
echo :: Filename: CHOP.BAT    Author: JOHN EVANS    Date written: 14.12.92 ::
echo ::                                                                    ::
echo :: Purpose:  To delete a number of lines from the top and/or bottom   ::
echo ::           of a file, and to optionally rename the resulting file.  ::
echo ::                                                                    ::
echo :: Syntax:   CHOP filename n1 n2 [newfilename]                        ::
echo ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
goto end

:errorcheck
if "%3" == "" goto error1
if not exist %1 goto error2
if "%1" == "%0" goto error3

:start
if "%2" == "0" if "%3" == "0" goto display
if "%2" == "0" goto bottom_only
if "%3" == "0" goto top_only
echo 1,%2d;#;-%3,#d > tmp.scr
goto main

:bottom_only
echo #;-%3,#d > tmp.scr
goto main

:top_only
echo 1,%2d > tmp.scr

:main
echo e >> tmp.scr
edlin %1 < tmp.scr > nul
del tmp.scr
if not "%4" == "" ren %1 %4

:display
echo First %2 line(s) and last %3 line(s) deleted.
if "%4" == "" echo Chopped file: %1
if not "%4" == "" echo Chopped file: %4
goto end

:error1
echo Syntax: CHOP filename n1 n2 [new filename]
echo where n1 = No. of lines to be deleted from top of file
echo       n2 = No. of lines to be deleted from bottom of file
goto end
:error2
echo %1 not found!
goto end
:error3
echo You typed chop %1 %2 %3 %4 !!!!!!!!!!!!!!
echo I'm NOT going to chop myself!
:end
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

Regards, John

-!- GED2.41 + FE1.4G + FD2.02 ---
 ! Origin: John's Box, Moenchengladbach, NRW, GER (2:2433/506)


 Area: Batch Language Programming                     FI 
  Msg#: 181                                          Date: 28 Aug 94  15:47:57
  From: Pete Rondeau                                 Read: Yes    Replied: No
    To: George Gilliam                               Mark:
  Subj: del *.* except *.zip?

GG>  Is there a batch file that will delete everything in a
GG> directory  besides the .zip file?  I have to use "del *.*
GG> /p" and it's very  inefficient.

How about..

DELNOZIP.BAT
---------------------
@echo off
attrib +R *.zip
echo y | del *.*
attrib -R *.zip
---------------------


ttyl,
                                               Pete
-!-
 ! Origin: "Quick Robin!  To the BatchCave!! (1:243/71.2)


 Area: Batch Language Programming                     FI 
  Msg#: 174                                          Date: 27 Aug 94  09:16:00
  From: Gary Cooper                                  Read: Yes    Replied: No
    To: Amer Neely                                   Mark:
  Subj: Re: NUL

 -=> Quoting Amer Neely to Akim Sissaoui <=-

 AS> What is the function of NUL variable in DOS environment ?

 AN> This special DOS reserved device name is used to redirect
 AN> output which you don't want to see to a "black hole". For
 AN> example when you load some  TSRs and other programs, there is
 AN> very often a message displayed on the  screen. If you don't
 AN> like / want this you can redirect the output to NUL  like this
 AN> from a batch file: c:\dos\mouse > NUL

Hi Amer:

I'm sure you have probably heard from others about this by now,
but, this is bad advice!  It is okay to redirect the output of most
programs to the NUL device, however, this does NOT hold true with
TSR's.  When the output of a TSR is redirected to NUL you end up
with a trapped file handle which may later cause problems for the
user.  When the output of a TSR is redirected to NUL, the file
handle that is used for the redirection is not released.  DOS treats
the NUL device as it would a file, and since the TSR does not
terminate, the file handle that was used is not released, reducing
the number of files which the user can have open at one time.  If
the TSR is later unloaded and the file handle released other
problems can occur which may require a reboot...

In brief, it is okay to redirect the output of other programs to the
NUL device, with TSR's it is not!

Hope this helps!

TTYL

Gary (T1'nNB)

... TSR - (T)rash (S)ystem (R)andomly
___ Blue Wave/QWK v2.12


-!- WM v3.10/91-0242
 ! Origin: Oasis BBS Saint John NB (506) 633-1344 (1:255/12)  (1:255/12)


 Area: Batch Language Programming                     FI 
  Msg#: 183                                          Date: 06 Sep 94  21:05:04
  From: Vernon Frazee                                Read: Yes    Replied: No
    To: Terry Blount                                 Mark:
  Subj: Removing Lines off the en

DD> What I want to do is strip the BLK-ERR lines  (1)  and  the  (2)
DD> line that goes with the BLK-ERR  line  to  the  same  file,  not
DD> to 2  separate  files,  so  I  end  up  with  a  new  file  that
DD> contains nothing but  the  (1)BLK-ERR  and  the  (2)  line  that
DD>  follows  it.  Please  post  an  example  of  how  to  do  this.

TB> If you want those lines saved to a new file in the SAME order they
TB> appear in the log then you can't do that with the Find program
TB> (unless you can find a particular character, word or sequence of
TB> characters that are unique to both lines and do not appear in the
TB> other lines).

    You can use somthing similar to:

      type filename.ext|find /n " "

    and FIND will put a unique number at the beginning of each line.

    For example, try this from the DOS prompt:

       dir c:\|find /n " "|more

TB> [ ... ] Since debug will not create an exe or com file [ ... ]

    DEBUG can create a COM file (because COM files are less than 64K).
    For example, load DEBUG and enter the following at it's hyphen ("-")
    prompt.  (Note: You do not need to type in the ";" or comments to
    the right of the ";"'s):

      N BEEP.COM   ; Tell DEBUG to work with a file named BEEP.COM
      A            ; Flip DEBUG's assembler mode on
      MOV DL,7     ; Put an ASCII 7 character (beep) in DL
      MOV AH,2     ; The DOS "display output" function
      INT 21       ; Kick DOS into action
      RET          ; Exit BEEP.COM to DOS
                   ; Hit [Enter] to exit DEBUG's assembler mode
      RCX          ; Setting up to write BEEP.COM to disk
      7            ; BEEP.COM will be 7 bytes
      W            ; Write BEEP.COM
      Q            ; Quit DEBUG

    You now have a little program named BEEP.COM (that does nothing more
    than beep) in your current directory.

    Vernon.Frazee@f71.n135.z1.fidonet.org

 -- SPEED 1.40 #1680:

-!- Olms 1.60 [PRSBN46N]
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)


Here is the latest BBS listing of BFDS Sites:

This list represents members of the Batch File Distribution Network
who accept file requests for BFDS files, or Downloads on the first call,
or downloads after a validation program. This list is by no means all
inclusive, and represents an attempt to get a reasonable geographic
distribution out to you in the FidoNet Echos. This list will be updated
monthly for posting in FidoNet Echos.

KEY:
Types: HST  = USRobotics Courier HST 14.4k
       HST+ = USRobotics Courier HST 16.8k
       HSTV = USRobotics Courier HST 21.6 V32terbo
       V32  = CCITT v.32 compliant
       V32B = CCITT v.32bis compliant
       CSP  = Compucom CSP
       ZYX  = Zyxel standard
       VFC  = Hayes V.Fast 28.8

FREQ:   U=Unlisted OK,   L=only in nodelist
DL:     Y=on first call, V=after validation, LDV=Long Distance Validation N=n/a

Hrs:  A=anytime but ZMH or
      listed times
Node: FidoNet Node Number or UL=not in nodelist
      (other net Node Number)

= *USA* ================================================================
St:     Phone:       Type:   FREQ: DL:      Hrs:        Node:
========================================================================
CA   (209)472-9750     V32     ?    ?         ?           1:208/205
CT   (203)897-7122     VFC     U    Y         A           1:141/1135
CT   (203)879-6254     V32     U    Y         A           1:141/1136
                                                           (8:909/5)
IO   (515)265-0164     ZYX     Y    ?         ?           1:290/10
LA   (318)582-6411     V32b    U    Y         A           1:3807/100
LA   (318)582-3509     V32b    U    Y         A           1:3807/101
MD   (301)649-3906     HST+    U    Y         A           1:109/541
MI   (616)964-3547     V32B    U    Y         A           1:11/450
                                                          (44:400/0)
NC   (704)541-6161     ZYX     U    V         A           1:379/36
OR   (503)756-3887     V32     U    Y    9PM to 9AM       1:356/3
SC   (803)499-4316     V32     U    Y         A           1:3647/1
WA   (206)427-1123     V32B    U    Y         A           1:352/111

= *Canada* =============================================================
St:     Phone:       Type:   FREQ: DL:      Hrs:        Node:
========================================================================
BC  (604)939-2060      HST     ?    ?         ?           1:153/771
BC  (604)820-0763      V32b    ?    ?         ?           1:153/527
BC  (604)682-0914      HST     U    V     04:00 - 01:00   1:153/767
BC  (604)687-0913      V32b    U    V        24 Hrs       1:153/797
BC  (604)689-0437      2400    U    V        24 Hrs       1:153/798
NFLD(709)579-3492      V32     U    V         A           1:255/400
NB  (506)652-2585      V32b    L    Y         A           1:255/6
AL  (403)262-5503      V32b    Y    Y        23 Hrs       1:134/32

= *Europe* =-===========================================================
CT:     Phone:       Type:   FREQ: DL:      Hrs:        Node:
========================================================================
UK  44-61-483-4105    V32      U    Y    0700-2359 GMT+1   2:25/997
UK  44-206-385358     V32      ?    ?          ?           2:257/607
UK  44-61-777-8088    V32      ?    ?          ?           2:250/109

GE  49-69-622423      V32b     U    Y          A           2:244/1153
---------------< cut here >-

Hope that will hold you until Dennis gets his swamp drained.  {^;
Good Modeming!  /\oo/\

NetMail at 1:382/1201, or Internet: bat@infomail.com


-!- Blue Wave/Max v2.12
 ! Origin: The HUB * Austin TX * Centex PCUG * 512-346-1852 (1:382/1201)


 Area: Batch Language Programming                     FI 
  Msg#: 174                                          Date: 12 Sep 94  02:15:08
  From: Don Hoffman                                  Read: Yes    Replied: No
    To: Nathan Obert                                 Mark:
  Subj: a "Simple" question.. (screen to file..)

 Quoting Nathan Obert/1:2370/39.0/ (07 Sep 1994,22:43) to Bat Lang

NO> RE: a "Simple" question.. (screen to file..)
NO> BY: Bat Lang to Nathan Obert on Tue Aug 30 1994 11:08 pm

 > CTTY >AAAEBLOG
 > ...
 > ::your batch file 'sandwiched' in between.
 > ...
 > CTTY >CON

NO> Thanx! that will really come in handy..

        Leave out the second '>', otherwise you'll lose a file
 handle that *nothing* will be able to recover.  (Ongoing
 discussion about this in the assembler echo.)  ie. just use

 CTTY CON

         The first usage of '>' may or maynot eat a file handle...
 but it will generally be recoverable even-so via special handle-
 recovery software.  (Probably unnecessary unless you're doing it
 repeatedly, and not rebooting) ... but any resident redirection
 to "CON" and the associated file-handle is HISTORY.


 Don
  ~~'

-!- GEcho 1.00
 ! Origin: point_of_confusion (1:138/173.5)


 Area: Batch Language Programming                     FI 
  Msg#: 172                                          Date: 13 Sep 94   9:04:00
  From: Horst Schaeffer                              Read: Yes    Replied: No
    To: Shai Sachs                                   Mark:
  Subj: counting boot-ups

-=> quoting Shai Sachs to All (21 Aug 94) <=-

SS> a while ago, someone asked about counting the number of boot-ups
SS> [...]
SS> can anyone figure out a way to print out exactly one character to
SS> a file?

I have seen several suggestions here about how to make a one byte
file, but counting boot-ups can be easily done if you keep the count
as a SET instruction in a BAT file.

Here is a solution for the AUTOEXEC.BAT that will run a programm
every 7th boot-up (remove comments):

    set BOOTS=x                             /* in case no \COUNT.BAT
    if exist \COUNT.BAT call \COUNT.BAT     /* execute: SET BOOTS=x...
    if not %BOOTS%==xxxxxxx goto WRITE      /* (or any other number)
    (*** run program here ***)
    set BOOTS=
    :WRITE
    echo SET BOOTS=%BOOTS%x> \COUNT.BAT    /* add an x & re-write
    ::                    ^^               /* no space in between!

Horst.

... Q4FM 2.01 ... Don't follow leaders!

-!- FM 2.02 / ScanToss
 ! Origin: HS.MUC Germany (2:2480/13.75)


 Area: Batch Language Programming                     FI 
  Msg#: 178                                          Date: 21 Sep 94  08:55:08
  From: Bob Steinbrecher                             Read: Yes    Replied: No
    To: Tom Potter                                   Mark:
  Subj: config menu example

TOM, I wrote this for a friend of mine hope it helps.


DOS 6.XX offers a very good way to setup multiple configurations with it's MENU
command for CONFIG.SYS. Using the multi-config setup is very easy (it has to be
if I can do it <G>), I have included my system files as an example of how to
put it all together.

MENUCOLOR=(BACKGROUND),(TXT) REM: USE ANSI SCREEN COLORCODES
MENUDEFAULT=(DEFAULT CONFIG), (DELAY TO DECIDE IF YOU WANT A DIFF. CONFIG.)

The rest is self explanatory or you can use the limited DOS HELP FILES.

BOB

**************************** CONFIG.SYS ************************************

[MENU]
MENUCOLOR=15,0
MENUDEFAULT=W, 10
MENUITEM=W, WINDOWS            CONFIGURATION
MENUITEM=G, GEOS20             CONFIGURATION
MENUITEM=F, DOS W/FAX ONLY     CONFIGURATION
MENUITEM=C, DOS W/MULTIMEDIA   CONFIGURATION
MENUITEM=S, DOS W/SMARTDRIVE   CONFIGURATION
MENUITEM=D, DOS W/ULTRASOUND   CONFIGURATION
MENUITEM=B, BYPASS ALL         CONFIGURATION


[W]
; WINDOWS CONFIGURATION
DEVICEHIGH=C:\CDROM\DD250.SYS /D:MSCD001 /C:99 /M:08 /I:5 /P:300

[G]
; GEOS20 CONFIGURATION
DEVICEHIGH=C:\CDROM\DD250.SYS /D:MSCD001 /C:99 /M:08 /I:5 /P:300

[F]
; DOS W/FAX N/SMARTDRIVE, MULTIMEDIA      CONFIGURATION

[C]
; DOS W/MULTIMEDIA, SMARTDRIVE            CONFIGURATION
DEVICEHIGH=C:\CDROM\DD250.SYS /D:MSCD001 /C:99 /M:08 /I:5 /P:300

[S]
; DOS W/SMARTDRIVE N/MULTIMEDIA           CONFIGURATION

[D]
; DOS W/ULTRASOUND N/SMARTDRIVE, CDROM    CONFIGURATION

[B]
; DOS N/SMARTDRIVE, MULTIMEDIA            CONFIGURATION


[COMMON]
DEVICE=C:\DOS\HIMEM.SYS
DEVICE=C:\DOS\EMM386.EXE RAM
DOS=UMB
DEVICEHIGH /L:1,12048 =C:\DOS\SETVER.EXE
DOS=HIGH
BUFFERS=50,0
FILES=100
FCBS=4,0
STACKS=9,256
SHELL=C:\DOS\COMMAND.COM C:\DOS\  /p
DEVICEHIGH /L:1,39488 =C:\DOS\DBLSPACE.SYS /MOVE

***************************** AUTOEXEC.BAT ******************************

@ECHO OFF
LH /L:1,6384 C:\DOS\Doskey
PROMPT $p$g
PATH C:\DOS;C:\BAT;D:\WINDOWS;C:\AWIN20;C:\ULTRASND;C:\GEOS20;LH /L:1,14192
IMOUSE.COM
SET TEMP=C:\dos
CALL C:\BAT\MAX.BAT
goto %config%

:W
@C:\CDROM\MSCDEX /D:MSCD001 /M:08 /L:G  /E
@LH /L:0;1,45456 /S C:\DOS\smartdrv.exe 2048 1024
win
goto done


:G
@C:\CDROM\MSCDEX /D:MSCD001 /M:08 /L:G  /E
@LH /L:0;1,45456 /S C:\DOS\SMARTDRV.EXE 1024
Geos20
goto done

:F
QL
goto END

:C
@C:\CDROM\MSCDEX /D:MSCD001 /M:08 /L:G  /E
@LH /L:0;1,45456 /S C:\DOS\SMARTDRV.EXE 1024
C:
goto done

:S
C:
goto done

:D
@LH /L:0;1,45456 /S C:\DOS\SMARTDRV.EXE 1024
C:
goto done

:B
C:
goto END

:done
SET ULTRASND=240,1,1,11,7
C:\ULTRASND\ULTRINIT
SET ULTRADIR=C:\ULTRASND
SET BLASTER=A240 I7 D1 T1

:END

-!- Maximus/2 2.01wb
 ! Origin: Smokey's Place BBS -- Ocala, FL / 904-368-6945 (1:365/47)


 Area: Batch Language Programming                     FI 
  Msg#: 191                                          Date: 21 Sep 94  18:49:00
  From: William Lipp                                 Read: Yes    Replied: No
    To: Kenneth J White                              Mark:
  Subj: Re: Saving file as day

 -=> Quoting Kenneth J White to All <=-

KJW> I need to save a group of files on a daily basis. I want the
KJW> .bat file to automatically save the file with the name of the day
KJW> (Example mon.zip tue.zip)

People in this echo often explain three ways using day and time
information in a batch file: simple redirection of the date and time
command, magic named batch file Current.bat, and redirection of the
prompt.  You problem is a prime candidate for the second method.  The
following lines will put the day name into an environment variable
"DAY."

    echo SET DAY=%%3 > Current.bat
    echo. | date > TempDate.bat
    call TempDate.bat
    erase Current.bat
    erase TempDate.bat

TempDate.bat will look like this:

          Current date is Wed 09-21-1994
          Enter new date (mm-dd-yy):

When you execute TempDate.bat, the first line will transfer control to
a batch file called Current.bat.  Current.bat looks like this:

         SET DAY=%3

Inside the magic named batch file Current.bat, the positional
parameters will be:
   %1 = date
   %2 = is
   %3 = Wed
   %4 = 09-21-1994

Note the "Enter" line of TempDate.bat will not be executed because
control was transfered directly to Current.bat, not via a "call."

For your implementation, you should consider changing to RAMDISK and
using it for the files.

-!- Blue Wave/QWK v2.10
* LAKOTA v1.3
-!- Alexi/Mail 2.02b (#33)
 ! Origin: * Glass Onion * Ansonia CT * USA * 203 732-5746 * (1:141/1295)


 Area: Batch Language Programming                     FI 
  Msg#: 198                                          Date: 26 Sep 94  16:04:00
  From: STEVE REID                                   Read: Yes    Replied: No
    To: GEOFF CUTTER                                 Mark:
  Subj: counting boot-ups

GC>To keep a count of something, you can use a zero byte file
GC>which has a number for a name (nnnn.GCC). STRINGS can read
GC>the file name, which is a number, and afterwards increment
GC>it by one. Part of a batch file I use is:

That requires a seperate program (STRINGS) that not everyone has. To use
any .COM or .EXE not included with MS-DOS is blasphemy against
MicroSoft, the God of Standards and Monopolies. It also makes the .BAT
less portable. Try something like this:

ECHO X>>COUNT

Then to find out how many times that command has been executed, you can
use the following command:

FIND /I /C "X" COUNT

The trick is the /C option in FIND. It counts the number of lines
containing "X" and displays the number. Simple, but effective.

If you want to place this number into an environment variable, you can
use the CURRENT.BAT trick used to catch the time and date. Only this
time, it's the --------.BAT trick.

XCOUNT.BAT:

@ECHO OFF
FIND /I /C "X" COUNT>TMPTMP.BAT
ECHO SET NUMBER=%%2>--------.BAT
CALL TMPTMP.BAT
DEL TMPTMP.BAT
DEL --------.BAT
ECHO Total count is %NUMBER%

If you have any trouble figuring out how this works, remove the
@ECHO OFF and the two DEL commands. Examine TMPTMP.BAT and --------.BAT.
If you still don't understand it, post me.

                           Steve Reid - Supreme Overlord of the Universe


Fido: STEVE REID (1:153/414)
Internet: sreid@sea-to-sky-freenet.bc.ca

-!-
  SLMR 2.1a 

-!- GOMail v1.2 [92-0609]
 ! Origin: Bandylan BBS, Squamish, BC (1:153/414)


 Area: Batch Language Programming                     FI 
  Msg#: 198                                          Date: 07 Oct 94  14:51:48
  From: Geoff Cutter                                 Read: Yes    Replied: No
    To: John Edmiston                                Mark:
  Subj: Re: BFDS in Australia

Good news. TARDIS in Melbourne has BFDS files.
regds           Geoff
-!- Blue Wave/Max v2.12
 ! Origin: TARDIS BBS (03) 819-7093 (3:633/260)


 Area: Batch Language Programming                     FI 
  Msg#: 172                                          Date: 12 Oct 94  13:45:21
  From: Vernon Frazee                                Read: Yes    Replied: No
    To: Robert Chalmers                              Mark:
  Subj: using print

RW> Somebody told me here a few months back how to generate a formfeed
RW> to your printer, so that it will feed to a new page, but I can't
RW> remember at the moment what you need to echo to itfrom your batch
RW> file.

RC> ECHO ^L > LPT1

    Keep in mind that since the "echo" command adds a carriage-return
    line-feed to everything it echos, the line:

      echo ^L > prn

    will not only send a formfeed to the printer but an extra
    carriage-return line-feed pair as well.  (The net result is the
    paper advances to the perforation and then one extra line-feed each
    time through your BATch file).

    One way to solve the problem is to first create a 1-byte file that
    contains nothing but the form-feed character ... like so:

      C:\>copy con ff.txt
      ^L^Z
              1 file(s) copied

    (Press [Ctrl-L] to create the ^L, [Ctrl-Z] to create the ^Z, and
    then press [Enter]).

    Then change the

      echo ^L > prn

    in your BATch file above to:

      copy ff.txt prn>nul

    (The ">nul" on the end simply hides DOS's "1 file(s) copied" msg.).

    Vernon.Frazee@f71.n135.z1.fidonet.org

 -- SPEED 1.40 #1680:

-!- Olms 2.Beta-4 [PRSBN46N]
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)


 Area: Batch Language Programming                     FI 
  Msg#: 183                                          Date: 17 Oct 94  15:29:08
  From: Gerry Pareja                                 Read: Yes    Replied: No
    To: Michael Druett                               Mark:
  Subj: Delete lines

 Quoting MICHAEL DRUETT | To: NELS STRAND | Subj: Delete lines

MD>echo 1d;1d;e>redin                     del line1, del line1, save & exit
MD>edlin file2.dat<redin>nul              execute Edlin using command file
REDIN

 Your compatriot Mitch Ames came up with the ultimate simplification for
 the above:

     echo dde|edlin file2.dat

 works like a charm.

MD> Sydney, Australia   +61-2-988-3076 (3:711/425)

 Bye from rainy Vancouver, Canada.

 Gerry


 * OLX 2.1 TD * G. Pareja * Vancouver * B.C. * Canada *

-!- Maximus 2.01wb
 ! Origin: VKUG/VPCC Batpower Echo - Richmond, BC (1:153/151)


 Area: Batch Language Programming                     FI 
  Msg#: 179             Rec'd                        Date: 22 Oct 94  05:31:02
  From: Michael Ayres                                Read: Yes    Replied: No
    To: Bat Lang                                     Mark:
  Subj: Response to Gordon Vanscheik

Hello Bat:

 > Venting one's spleen in an international echo is not recommended, and I
 > hope you will find it within yourself to apologize.  Good Modeming!  /\oo/\

  Very nicely put - couldn't have said it better!  Many thanks...

Michael

-!- FMail 0.96
 ! Origin: Tullamore / Wichita Falls, Texas USA (1:3805/24)


 Area: Batch Language Programming                     FI 
  Msg#: 192                                          Date: 24 Oct 94  14:50:00
  From: William Lipp                                 Read: Yes    Replied: No
    To: Oliver Kneip                                 Mark:
  Subj: Re: hidden file i cant de

 -=> Quoting Oliver Kneip to All <=-

OK> I have a file called .zip.277 ...
OK> it is making life dificult for me ...
OK> I can not delete this file at all ...
OK> it is a hidden file

As you probably know, the worst part of your problem is that you have
an "invalid" file name, with a period in the name part.  Most programs
know that the period can only be the separator between the file name
and the file type, and proceed on that basis.  An additional
complication is that the file is hidden, and must be unhidden before
deleting.  Sometimes wild cards can get around these problems.  Try
things like

  attrib -h *.277
  attrib -h ?zip.277

  rename *.277 x.277
  rename ?zip.277  x.277

  erase *.277
  erase ?zip.277
  erase *.*  (This would require the "attrib" to have worked, and
              will erase everything else in the subdirectory, too)

I'm assuming there isn't anything else to save in the same subdirectory.
As a desperate measure, find the PcTools program that changes attributes,
and change the _sub-directory_ to be a file, then erase the file.  This
should make the .zip.277 file into lost clusters that you can reclaim
with chkdsk or another utility.

-!- Blue Wave/QWK v2.10
* LAKOTA v1.4
-!- Alexi/Mail 2.02b (#33)
 ! Origin: * Glass Onion * Ansonia CT * USA * 203 732-5746 * (1:141/1295)


 Area: Batch Language Programming                     FI 
  Msg#: 194                                          Date: 24 Oct 94  14:55:00
  From: William Lipp                                 Read: Yes    Replied: No
    To: Jeff Gulley                                  Mark:
  Subj: Re: loop help

 -=> Quoting Jeff Gulley to All <=-

JG> What I want to do is set the loop to execute a maximum
JG> of five times..on the sixth to exit out..delete the
JG> offending packet..and continue to run the bat file...the
JG> last step will close that session.

JG> I am not too sure..but I don't think that I can do it
JG> with environemt variables...I don't believe they can be
JG> operated on arithmatically..

How about appending "X" to an environment variable each loop, and
quitting when the environment variable is XXXXXX?  Something like

set LOOP=
:LOOP
set LOOP=%LOOP%X
if %LOOP%==XXXXXX GOTO OFFEND
loop stuff
if errorlevel 1 goto LOOP


-!- Blue Wave/QWK v2.10
* LAKOTA v1.4
-!- Alexi/Mail 2.02b (#33)
 ! Origin: * Glass Onion * Ansonia CT * USA * 203 732-5746 * (1:141/1295)


 Area: Batch Language Programming                     FI 
  Msg#: 151                                          Date: 28 Oct 94  08:34:00
  From: William Lipp                                 Read: Yes    Replied: No
    To: Montgomery Hounchell                         Mark:
  Subj: Re: Batch file manual?

 -=> Quoting Montgomery Hounchell to All <=-

MH> I am interested in learning to create Batch files.
MH> I have attempted to teach myself this through my Dos manuals.  But I
MH> am having difficulty in absorbing the data..

I'm sure you'll get responses from people who are familiar with the
books.  I while back I gave Kirk Walker the following advice about
learning batch files from the DOS manual.  It still looks good to me:

You're motivated, so you've got the hardest part solved.  If you don't
already know, use that old manual to learn what these things mean in
batch files (most of them mean the same things at the command prompt, too)
  1. >
  2. >>
  3. |
  4. GOTO   (and :LABEL)
  5. IF ERRORLEVEL
  6.  %1  %2
  7. SET ENV=
  8. %ENV%  (This one may not be in the manual.  It works like %1,
             except the value is taken from the environment variable)
  9. IF ...=...
 10. IF EXIST
 11. for %%x in (set) do ...

If you understand these 11 things, you'll be able to follow most of
what is posted here.  These are the basic tools in the batch programmer's
tool box.


-!- Blue Wave/QWK v2.10
* LAKOTA v1.4
-!- Alexi/Mail 2.02b (#33)
 ! Origin: * Glass Onion * Ansonia CT * USA * 203 732-5746 * (1:141/1295)


 Area: Batch Language Programming                     FI 
  Msg#: 145                                          Date: 28 Oct 94  21:50:06
  From: Gerry Pareja                                 Read: Yes    Replied: No
    To: Phoenix                                      Mark:
  Subj: Time

PH>How do you log the time to a log file?  I run a bbs and would like to be
able
PH>to have the time certain events occur to be logged into the log files.  Any
PH>ideas?

 Yep.  Try this, plain MS-DOS (no external utilities) method:


 @echo off
 echo @prompt Event occurred on $d at $t>temptime.bat
 command /c temptime.bat>>c:\mylog.fil
 del temptime.bat

 which will append lines to C:\MYLOG.FIL (modify as needed) that look
 like:

 Event occurred on Sun 10-30-1994 at 12:02:22.33p
 Event occurred on Sun 10-30-1994 at 12:33:33.44p
 Event occurred on Sun 10-30-1994 at 12:44:55.55p

 etc.etc.

 How does it work?  The short explanation is that the PROMPT issued by
 the COMMAND /C temporary shell, instead of being displayed on the
 screen as is normal with prompts, is redirected (and appended) to a
 file that you name.

 This method has worked for me under MS-DOS 3.3, 5.0, and 6.22.

 Gerry


 * OLX 2.1 TD * G. Pareja * Vancouver * B.C. * Canada *

-!- Maximus 2.01wb
 ! Origin: VKUG/VPCC Batpower Echo - Richmond, BC (1:153/151)


If you have a favorite Dutch board that is interested, give them the
above information.  If they also support V.32b, so much the better.
Good Modeming!  /\oo/\  en Groeten!  {^;

-!- Blue Wave/Max v2.12
 ! Origin: The HUB * Austin TX * Centex PCUG * 512-346-1852 (1:382/1201)


 Area: Batch Language Programming                     FI 
  Msg#: 200                                          Date: 31 Oct 94  10:31:02
  From: David Adamson                                Read: Yes    Replied: No
    To: Shawn Oatley                                 Mark:
  Subj: Error List

 SO> I remember a while ago, I had a program that when I would
 SO> type it in and list a Run-Time error number, it would come
 SO> up with what it meant.  Example:
 SO> ERROR 102
 SO> Error 102 is a ......

I think a text file is a more straight-forward solution.

______________________________________O/_____C_U_T______________
                                      O\

        2  -  No such filename in directory
        3  -  No such directory path
        4  -  Too many files opened simultaneously
        5  -  File access denied for intended operation
        6  -  Unrecognized file handle
       12  -  Attempted file access with wrong filemode
       15  -  Invalid drive number used in getdir
       16  -  Directory cannot be removed by rmdir
       17  -  Drives specified by rename cannot differ
      100  -  Attempted read past end of file
      101  -  Disk data area is full
      102  -  Cannot attempt I/O without assigning file
      103  -  File not prepared with reset or rewrite
      104  -  File not prepared to be read from
      105  -  File not prepared to be written to
      106  -  Illegal numeric format in data
      150  -  Attempt to read write-protected disk
      151  -  Unit is unknown
      152  -  Disk drive is not ready
      153  -  Command is unknown
      154  -  Error in cyclical redundancy check
      155  -  Invalid drive request structure length
      156  -  Seek error on disk
      157  -  Media type is unknown
      158  -  Disk sector not found
      159  -  Printer is out of paper
      160  -  Write fault on I/O device
      161  -  Read fault on I/O device
      162  -  General hardware failure

___ Blue Wave/QWK v2.12

-!- Maximus 2.00
 ! Origin: The Dragon's Lair - (205) 263-9272 (1:375/300)


 Area: Batch Language Programming                     FI 
  Msg#: 187                                          Date: 01 Nov 94  23:53:35
  From: Bill Palson                                  Read: Yes    Replied: No
    To: Herman Verbrugge                             Mark:
  Subj: Device as file on HD

HV>DIR

HV>COM2     7  05-22-94   7:57p

I read about a similar problem in PC Computing. The reason you can't get
rid of the file is because it has the same name as a port (and you CAN'T
delete a port). What you must do is change to the drive that the file is
on, and then type DEL ????. BUT!!!!! before doing so, type DIR ????. and
make sure that there are no other files that show up in the DIR search,
otherwise you will delete ALL of the files that match the description.

        Many thanks to PC Computing for this and MUCH more invaluable
        information it has afforded me.


 * OLX 2.1 * Vote ABC in '96 - (Anybody But Clinton)
-!- Renegade v07-17 Beta
 ! Origin: Dreamweaver BBS * Camp Hill (717) 774-4970 (1:270/714)


 Area: Batch Language Programming                     FI 
  Msg#: 185                                          Date: 31 Oct 94  17:39:00
  From: Marc Venema                                  Read: Yes    Replied: No
    To: John Gray                                    Mark:
  Subj: ERRORLEVEL informer

 > A long, long time ago, I posted a re-entrant/
 > recursive/calls itself
 > repeatedly JG-written BATch file to inform the user of
 > the errorlevel
 > returned by a program.

I once made a simple batch file to do this. Just type erl after the program or
whatever stopped and it returns the errorlevel...

ERL.BAT:

@echo off
for %%i in (0,1,2) do if errorlevel %%i00 set H=%%i
for %%i in (0,1,2,3,4,5,6,7,8,9) do if errorlevel %H%%%i0 set T=%%i
for %%i in (0,1,2,3,4,5,6,7,8,9) do if errorlevel %H%%T%%%i set E=%H%%T%%%i
echo Errorlevel=%E%
set E=
set H=
set T=

Marc

-!- GEcho 1.00
 ! Origin: CoSysOp of GoBBS 053-321321 2:283/728.0 (2:283/728.9)


 Area: Batch Language Programming                     FI 
  Msg#: 168                                          Date: 02 Nov 94  13:35:10
  From: Tyrin Price                                  Read: Yes    Replied: No
    To: Brian Durham                                 Mark:
  Subj: 5th Boot Up

Hello Brian!

Monday October 31 1994, Brian Durham writes to All:

 BD> Need a batch file to run a program or call another batch
 BD> file to run every 5th boot up. ie; 5,10,15 ect... Thanks.

Try adding this to your AEbat file...

IF EXIST c:\boot5.flg GOTO 5TH_BOOT
IF EXIST c:\boot4.flg REN c:\boot4.flg boot5.flg
IF EXIST c:\boot3.flg REN c:\boot3.flg boot4.flg
IF EXIST c:\boot2.flg REN c:\boot2.flg boot3.flg
IF EXIST c:\boot1.flg REN c:\boot1.flg boot2.flg
GOTO skip
:5TH_BOOT
REM CALL your 5th boot batch file here.
REN c:\boot5.flg boot1.flg
:skip

Now issue the following DOS command...

REM > c:\boot1.flg

This will write a zero length file called boot1.flg that'll start the
process.  Each successive boot will increment the flag file.  On the 5th
boot your special program will run.

*CAUTION*
You may want to try something different if you use a disk doubler.
I believe some of them have trouble with zero length files.
*CAUTION*

Tyrin

-!- GoldED/P32 2.42.G0214
 ! Origin: Shadow Rider BBS =o&>o Millington, TN (901) 873-1570 (1:123/422)


 Area: Batch Language Programming                     FI 
  Msg#: 186                                          Date: 08 Nov 94  13:11:00
  From: William Lipp                                 Read: Yes    Replied: No
    To: Randy Blizzard                               Mark:
  Subj: Re: shift command

 -=> Quoting Randy Blizzard to Vernon Frazee <=-

RB> Some time back you gave me and others some great advise on the dos
RB> CHOICE command. I now use it a lot in my batch files. I was wondering
RB> if you or somebody could post a few tips on the SHIFT command.

When you start a batch file, the parameters %0 %1 %2 ... %9 have the
parameters used on the command line.  After a "SHIFT" command, these
values all shift, the zero value getting what was the one value, the
one value getting what was the two value, and the 9 value getting the
next line out.  For example, when you start a batch file with

    Test.bat  A1 B2 C3 D4 E5 F6 G7 H8 I9 J10 K11 L12

%0 through %9 are "Test.bat" through "I9"

After "SHIFT" they are "A1" through "J10"

I know of three uses for this.
1. Sometimes you know there are more than 9 arguments on the command line.
  This is the only way I to use them.
2. Sometimes you don't know how many arguments will be on the command line,
  but you want to do the same thing for each of them.  For example,
  I use a system of "goto" batch files that change to a particular
  directory and then start up an application.  If I include extra
  parameters in the calling line, these are nested subdirectories to
  change to before starting the application.  The code does something
  like this:
         :LOOP
         if (%2)==() goto NEXT
         CD %2
         shift
         GOTO LOOP
3. Sometimes you don't know how many arguments will be on the command line,
  but you want the last.  There was a post here that used the "magic named
  file" trick with the Attrib command.  The file name will be the last
   entry on the line.  Because the file may also be hidden or system,
  the file name may be %1 or %2 or %3.  A possible solution is
     :LOOP
     if (%2)==() GOTO NEXT
     shift
     GOTO LOOP
  When you get to NEXT, the file name will be in %1, regardless of
  where it began.





-!- Blue Wave/QWK v2.10
* LAKOTA v1.3
-!- Alexi/Mail 2.02b (#33)
 ! Origin: * Glass Onion * Ansonia CT * USA * 203 732-5746 * (1:141/1295)


 Area: Batch Language Programming                     FI 
  Msg#: 195                                          Date: 09 Nov 94  22:49:00
  From: John Evans                                   Read: Yes    Replied: No
    To: Allan Holtzmann                              Mark:
  Subj: Is it possible...

Hello Allan,

Friday November 04 1994 12:23, Allan Holtzmann wrote to All:

 AH>    Is it possible to delete lines from a .txt file via a batch file??
 AH> Will EDLIN do this?  I need to delete the first few lines of a group of
 AH> .txt files and I wanted a program that I could call from a batch to do
 AH> the trick...

Wow! Someone who's not afraid of EDLIN! Try this:

 :: YOUR.BAT :::::::::::::::::::::::::::::::::::::::::::::
 [...]
 for %%x in (first.txt second.txt etc...) do call chop %%x n 0
 [...]
 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::

where "n" is the number of lines to be removed from the top. Here's chop.bat:


 @echo off
 if not %1 == /? goto errorcheck
 echo ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 echo :: Filename: CHOP.BAT   Author: JOHN EVANS   Date written: 14.12.92 ::
 echo ::                                                                  ::
 echo :: Purpose:  To delete a number of lines from the top and/or bottom ::
 echo ::           of a file, and to optionally rename the resulting file.::
 echo ::                                                                  ::
 echo :: Syntax:   CHOP filename n1 n2 [newfilename]                      ::
 echo ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 goto end

 :errorcheck
 if "%3" == "" goto error1
 if not exist %1 goto error2
 if "%1" == "%0" goto error3

 :start
 if "%2" == "0" if "%3" == "0" goto display
 if "%2" == "0" goto bottom_only
 if "%3" == "0" goto top_only
 echo 1,%2d;#;-%3,#d > tmp.scr
 goto main

 :bottom_only
 echo #;-%3,#d > tmp.scr
 goto main

 :top_only
 echo 1,%2d > tmp.scr

 :main
 echo e >> tmp.scr
 edlin %1 < tmp.scr > nul
 del tmp.scr
 if not "%4" == "" ren %1 %4

 :display
 echo First %2 line(s) and last %3 line(s) deleted.
 if "%4" == "" echo Chopped file: %1
 if not "%4" == "" echo Chopped file: %4
 goto end

 :error1
 echo Syntax: CHOP filename n1 n2 [new filename]
 echo where n1 = No. of lines to be deleted from top of file
 echo       n2 = No. of lines to be deleted from bottom of file
 goto end
 :error2
 echo %1 not found!
 goto end
 :error3
 echo You typed chop %1 %2 %3 %4 !!!!!!!!!!!!!!
 echo I'm NOT going to chop myself!
 :end
 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

Regards, John

-!- GED2.41 + FE1.4G + FD2.02 ---
 ! Origin: John's Box, Moenchengladbach, NRW, GER (2:2433/506)


 Area: Batch Language Programming                     FI 
  Msg#: 171             Rec'd                        Date: 10 Nov 94  15:03:03
  From: Rob Flor                                     Read: Yes    Replied: No
    To: Bat Lang                                     Mark:
  Subj: ALTER request

-> I would like ALTER to be able to recognize a couple of new switches,
-> an object filename.  eg: (using existing switch settings as in TSNR21
->
-> -i = ignore case
-> -k = keep existing case
->
-> @<filename> = list of object filespecs
->
-> Such that:
->
-> SYNTAX: ALTER FileSpec (wildcards ok) "Old Text" "New Text"
->
-> would recognize: ALTER @FileSpec -i -k "g:\" "h:\"

Sure thing, I will look into that.

Rob


-!- WM v2.09/92-0020
 ! Origin: The Purple Rose of Cairo, NY (914)473-1697 VFC (1:2624/401)


Good Modeming!  /\oo/\

... Fido NetMail: 1:382/1201, or Internet: bat@infomail.com
-!- Blue Wave/Max v2.12
 ! Origin: The HUB * Austin TX * Centex PCUG * 512-346-1852 (1:382/1201)


 Area: Batch Language Programming                     FI 
  Msg#: 169             Rec'd                        Date: 11 Nov 94  15:08:00
  From: Gerry Pareja                                 Read: Yes    Replied: Yes
    To: Bat Lang                                     Mark:
  Subj: ALTER request

 Quoting BAT LANG | To: ROB FLOR | Subj: ALTER request

BL>Scenario: You have been using g:\ as your RAMdisk, but after installing
BL>a new drive and repartitioning, the RAMdisk will hereafter be h:\

BL>then the above files list is generated.  Thus, I have 24 batch files
BL>needing all instances of g:\ or G:\ to be 'alter'd to become h:\.

 I had a similar problem.  Since I often make copies of my batch files
 and pass them along to friends or the office, I needed a "variable" for
 the Ramdrive letter.  So, I decided that every computer that I have
 "edit access" to (meaning the owner expects me or allows me to edit
 his/her system and batch files) will have, right at the beginning of
 AUTOEXEC.BAT, the following line:

     SET RAM=G:

 (or whatever letter works).  The idea being that once that is set, I
 never worry about it again.  All batch files from then on reference the
 Ramdrive as %ram% (for which of course I have a tiny macro).

 So, I wanted to suggest that, in the process of editing your batch
 files, replace G:/g: with %RAM% instead of 'the next letter' in the
 alphabet.

 Btw, did you catch CMDINS when it was posted here?  It  looked like it
 could automate your processing, once you have the list of BAT files, by
 inserting the appropriate commands in the right places, and generating
 another batch file for you.

BL>where FileSpec inside looks like:

BL>C:\BAT\BF.BAT
BL>C:\BAT\CZ.BAT
BL>C:\BAT\DC.BAT
BL>C:\BAT\OLDPATH.BAT
BL>C:\BAT\P.BAT

 The command:

      cmdins test.lst test.bat ALTER ~ "G:" "%%RAM%%"

 Would generate:

ALTER C:\BAT\BF.BAT "G:" "%%RAM%%"
ALTER C:\BAT\CZ.BAT "G:" "%%RAM%%"
ALTER C:\BAT\DC.BAT "G:" "%%RAM%%"
ALTER C:\BAT\OLDPATH.BAT "G:" "%%RAM%%"
ALTER C:\BAT\P.BAT "G:" "%%RAM%%"

 CmdIns Version 1.1 by NetWalker -------------------------- Pentac 1994

 SYNTAX : CMDINS input_filename output_filename commands... [/CMDSTAT]

 This CMDINS tool will basically read each lines of the input file, and
 output into the output file using the options provided. The options can
 be any string containing the character "~". This character "~" will be
 automatically replaced by the contents of the input file. Also if you
 use the character ";" in the option, CMDINS will automatically insert a
 new line (read CMDINS11.DOC for more info). Additional "/CMDSTAT"
 command can be appended at the end of the commands to make CMDINS
 display it's status screen.


 Gerry

 P.S.: The person to ask is: Minoru Toda, mtoda@interaccess.com


 * OLX 2.1 TD * G. Pareja * Vancouver * B.C. * Canada *

-!- Maximus 2.02
 ! Origin: VKUG/VPCC Batpower Echo - Richmond, BC (1:153/151)


 Area: Batch Language Programming                     FI 
  Msg#: 172                                          Date: 11 Nov 94  18:48:04
  From: Gerry Pareja                                 Read: Yes    Replied: No
    To: Ingo Kley                                    Mark:
  Subj: Date & Time To File

 Quoting INGO KLEY | To: REED MITCHELL | Subj: DATE & TIME TO FILE

IK> > Is there some way to write (really append) the time and date to a file?
IK>First you have to run the following batch :

IK>================================SETDATI.BAT=================
IK>Afterwards you can use :
IK>ECHO %ZEIT% %DATUM%             >> FILE.LOG

 Here's a faster and neater way, and it allows up to 9 words for
 comments:

 @echo off
 echo @prompt $d - $t %%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 %%9>temp.bat
 command /c temp %1 %2 %3 %4 %5 %6 %7 %8 %9|find ":">>logfile.txt
 del temp.bat

 Sample output:

 Fri 11-04-1994 -  9:31:58.60
 Fri 11-04-1994 -  9:32:01.40 Whatever you type here will go in LOGFILE.TXT
 Fri 11-04-1994 -  9:32:42.32 Type whatever you need logged here
 Fri 11-04-1994 -  9:33:08.08 Computer booted in DOS configuration
 Fri 11-04-1994 -  9:33:15.82 Computer booted in plain configuration

 etc.etc.

 Gerry


 * OLX 2.1 TD * G. Pareja * Vancouver * B.C. * Canada *

-!- Maximus 2.02
 ! Origin: VKUG/VPCC Batpower Echo - Richmond, BC (1:153/151)


 Area: Batch Language Programming                     FI 
  Msg#: 165                                          Date: 16 Nov 94  23:11:04
  From: Gerry Pareja                                 Read: Yes    Replied: No
    To: Rodney Richison                              Mark:
  Subj: Monthly Batch

RR>Need a batch file to check date and run program on certain day of each
month.

 Let's say you wish to run something on the 15th of each month.
 Assuming US-style date, how about this:

 @echo off
 echo.|date|find "-15-">temp
 copy temp+,, >nul
 if exist temp goto its_the_15th
 goto not_the_15th

 :its_the_15th
 del temp
 echo It's the 15th! ............ Your application goes here.
 goto end

 :not_the_15th
 echo It's not the 15th, so we quit.

 :end
 :::::::::::::::::::::::::::::::::::::::

 How does it work?

 The line:   echo.|date|find "-15-">temp

 generates a zero-byte (empty) file every day except the 15th.  Our
 friends on other continents can alter this to " 15-" or "15/" if the
 day is the first number in the date.

 The line:   copy temp+,, >nul

 deletes any zero-byte file, but keeps any non-zero-byte file.

 Gerry


 * OLX 2.1 TD * G. Pareja * Vancouver * B.C. * Canada *

-!- Maximus 2.02
 ! Origin: VKUG/VPCC Batpower Echo - Richmond, BC (1:153/151)


 Area: Batch Language Programming                     FI 
  Msg#: 186                                          Date: 17 Nov 94  00:04:00
  From: Gerry Pareja                                 Read: Yes    Replied: No
    To: Shawn Bierman                                Mark:
  Subj: Setting environment var.

SB> How can I pass the contents of a text file out to an environment
SB>variable.  Nothing huge, just one simple line (i.e. 354).  I have a
SB>batch file that uses the "find" command to count occurrences of a
SB>certain character and I pass that number to a text file.  I would like
SB>to be able to dump it to an environment variable.

 This raises a question: did you realize that FIND does _not_ actually
 count occurrences of a certain character, but it counts the number of
 _lines_ containing 1 or more instances of that character?

 OK.  Assuming the above is to your satisfaction, how are you passing
 the number to the text file:

 1) find /c "X" <myfile >temp

 which gives something like:

 354  (one word on one line)

 or

 2) find /c "X" myfile >temp.bat

 which gives TEMP.BAT:

 ---------- MYFILE: 11

 I think this method is more useful, because then we can create a batch
 file called --------.bat which sets the env.var. you desire:

 echo set count=%%2>--------.bat

 then,

 CALL TEMP, which calls --------, which returns the number you need in
 an env.var.

 So, to put it all together:

 @echo off
 find /c "X" myfile >temp.bat
 echo set count=%%2>--------.bat
 call temp
 echo COUNT is: %count%
 :end

 Gerry


 * OLX 2.1 TD * G. Pareja * Vancouver * B.C. * Canada *

-!- Maximus 2.02
 ! Origin: VKUG/VPCC Batpower Echo - Richmond, BC (1:153/151)


 Area: Batch Language Programming                     FI 
  Msg#: 197                                          Date: 18 Nov 94  16:42:05
  From: Vernon Frazee                                Read: Yes    Replied: No
    To: Dana Harding                                 Mark:
  Subj: % symbols

DH> Hi all, I'm actually pretty good with things like dos commands (not
DH> an expert, but pretty good), but when it comes to different .bat
DH> file commands I'm not so great. One thing that bugs me about them is
DH> the "%" symbol, what is it used for and what does it mean. I just
DH> want this info. so that when I'm reading other messages on this echo
DH> I can understand commands like "%chioce%%" or other ones. I would
DH> appreciate any response. Thanks, in advance.

    Maybe one of the easiest ways for you to see what it does is with an
    example.  First, type the following at the DOS prompt:

      set name=Dana Harding

    This line creates an environment variable named "name" that contains
    the string:

      Dana Harding

    To view the items in your environment you can type:

      SET

    Tip: If the environment variables are scrolling off of the top of
         the screen before you get to view them, use the command:

           SET|MORE

    Next create a little BATch file, from the DOS prompt again, by
    entering the following two lines:

      copy con x.bat
      @echo %name%

    Press [Ctrl-Z] and then [Enter] at the end of the second line to
    save the file.  Now simply type:

      x

    and X.BAT will echo:

      Dana Harding

    In other words, the percent signs surrounding a string of characters
    tells DOS to find an environment variable matching the string
    instead of literally echoing %string%

    A single percent sign in front of a number from 1 to 9, for
    instance:

      echo %1

    tells DOS to echo the "nth" parameter that was entered on the
    command line (after the name of the BATch file).  If a BATch file
    named X.BAT contained:

      @echo %1 %2 %3 %4 %5 %6 %7 %8 %9

    and you entered:

      x now is the time for all good men to come to aid of their country

    when DOS processed X.BAT, it would echo:

      now is the time for all good men to

    not the string:

      %1 %2 %3 %4 %5 %6 %7 %8 %9

    Tip: The SHIFT command allows access to variables beyond %9

    Vernon.Frazee@f71.n135.z1.fidonet.org

 -- SPEED 1.40 #1680:

-!- Olms 2.0 [PRSBN46N]
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)


 Area: Batch Language Programming                     FI 
  Msg#: 199                                          Date: 18 Nov 94  11:50:33
  From: Spencer Fritz                                Read: Yes    Replied: No
    To: Joe Pike                                     Mark:
  Subj: ECHO BINARIES

==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-
 S.P.A.F.T. |  @@@@@@   @@@@@@@     @@@@    @@@@@@@@  @@@@@@@@ | S.P.A.F.T.
 a r s o e  | @@@@@@@@  @@@@@@@@   @@@@@@   @@@@@@@@  @@@@@@@@ | a r s o e
 v o   r x  | @@!  !@@  @@!  @@@  @@!  @!@  @@!         !@@    | v o   r x
 e g a m t  | !@!       !@!  @!@  !@!  !@@  !@!         @!!    | e g a m t
 / r s a    | @!@!!@!   @!@!@!@!  @!@!@!@!  @!@!@!!     !!@    | / r s a
 s a c t    |  !!@:!@   !@!!:@!   !@!:!!@!  !@!!:@!     !!!    | s a c t
 e m i      |      !:!  !!:       !!:  !:!  !!:         !:!    | e m i
 n s i      | !:!  ::!  :!:       :!:  :!:  :!:         :!:    | n s i
 d      For | ::::::::  :::       :::  :::  :::         :::    | d     For
  MS/PC DOS |  ::::::   :::       :::  :::  :::         :::    | MS/PC DOS
==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-==-
It has come to my attention that there are many binary files transfered on
this echo. Chad Wagner's XXBUG v2.21 is an intersting binary to text util.,
but all the editing to piece together a file bytes! I'm the author of Spaft
Utilities, a much better solution to binary to text conversion. Here is an
overview of the advantages you might enjoy by switching to Spaft Utilities.
---------------------------------------------------------------------------
Note: The XXBUG files shown below have been edited to there original size.
         Binary File    | ZIP Size | XXBUG Size | Spaft Size | Difference |
      Joe Pike's JUMP20 |  7371    |  11125     | 9840,2parts| 1285 bytes |
David Adamson's RNSET22 |  5101    |   7971     | 6757 1part | 1214 bytes |
---------------------------------------------------------------------------
Chad Wagner's XXBUG v2.21 advantage is everyone has debug.com to use as the
decoder, but the hassle of all the editing is a problem. Spaft Utility was
designed for Internet Email, FidoNet Netmail, USENET, an Echos. Some of the
features are, command line driven, smallest output file size of any conver-
sion utility, excellent path and file handling, file splitting into upto 99
parts, smart decoder ignores unwanted text inserted by the remote system,
error logging, a checksum and byte count to insure data integrity, output
file size forcasting, and excellent documentation. The output text format
is compatible with most telecomm. script languages and includes MMK.EXE, a
program to create scripts. Another plus is the ability to seach the input
files for many parts, these parts may be in any order, good for echos, no?
---------------------------------------------------------------------------
This is a spaft of PLAID.ZIP. It consists of two files PLAID.COM,4212 bytes
a small application program compiled from assembly language that displays a
colorful extended ASCII screen, and PLAID.DOC, 218 bytes, that explains the
functions of PLAID.COM. If you save this text to disk as <anyfilename> then
execute UNSPAFT.EXE, and at the DOS prompt type: UNSPAFT anyfilename
UNSPAFT.EXE would search this text for the spaft text format header (below)
then open the file PLAID.ZIP and recreate this binary file from the jibber-
ish below exactly as SPAFT.EXE found it before the convertion to text.
_SPAFT_for_file_PLAID.ZIP   _Part_01_of_01__SPAFTv21
|#vq&'#7####+##v+z>12>NrU%&##g3###,####vr#gojQ%iusg8{F86(g7KRcKG]rRwYkP?Uz3L
|)kbQf13eE@4Ik=v(fHh+>WY0s['-Af)g+w&sU@ca1Ab2#knr<([<if3tdH:'A\A9ke1KaqBjq<6
|V.H\TVkqgZvmU>CGI&EU.r>j5Kt$tBDvJ+t7xJM<l#63[]pn5*?bNzz07u=ci;gBbU{n[b]gR:P
|]bu72hu@1\+OuHWIw0=l+<k6.g.X8sROS5XA+jend1Ht1M.3N]6BN]CG48iFI>E84][obc.Q:>P
|@lbgFKL4'TPCU2Ih@rm2\l[eq9ku#.m-LnpPm2YMLU]'p\:w8r2TqWZ%*njtqkb3a)GW2B::E-B
|d@g<<sD;woM0#]s0jQu=IWexPbhtsdgA,Ri.1-NM,q(TNW1<16:ejW@AHV)bC/TI7buc=c.2Jpa
|E@b:$&3]g[r:*Ij..I0b()vnZY?rY[q<NN-HIV6I)AK>ZY8G4VIxpFpEzehFOh)\>R)a.G7va)N
|tG>WHS+[FbQ{3#)\\9nLuC/A6BQ1uXF-:7+UNl%s:'P+oa>0mFQxw<7H8>6mqeb)iAKB&@TmFO&
|M#jS\2suyAEh99JYe{\+iyGewTD2[CI:[Bj.Fug>KHD\ggK+Yr,LK>pk.wsDiEHx<s6w{*6:U@A
|PD),0X@dSd$p{&&$0]bu2s5%hFFsTBpHT>Uv6yD6=*DugmyE6w0>ILPmi<WVr76NL7&y)xvwNvu
|#:vq&#'7####+###vz>(6fvuw%###.####,####v#rgoj#Qjui:.j>nUAH@pbq{?O>#nzK;uD@w
|)npDn#Oqsw#KtQp5sDyn[@OQ?5o#zKY@nOw)KRAO&o(z')MNBr6oD*W-9eMEe]e;=qbk?(/JvuM
|Pt\:L;Gaa#+oCADpFBuE;KAFs#(TVqilXWBTM)F2HyFHihsFV\&Cky8/HyFL#f>Dlm]v]]$:{%Z
|#.Ptr<u,)>gC{zj;t$+y8K@$+5ODO$YA##v#q$%7##7####+##%vz>1e2NrU$%##g#3##,#####
|#######C#########vrg#ojQi#usvq#$%7##7####+##v#z>(f\vuw#)##.####,#########$#
|#C###>&%###vrgo#jQju#ivq(#)#####%#%,#;####J&#####__
_End_of_file_PLAID.ZIP   _No._of_bytes 939_Checksum 0/ 100525
Upon completion UNSPAFT.EXE will check the bytecount & checksum data on the
(End of file) line above to confirm data integrity. Uncompressing PLAID.ZIP
(ZIPv.204g) will recreate PLAID.COM/DOC.(No copies sent by FidoNet NetMail)
+--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--+
| <spencer.fritz@techtalk.com> <--- RinkyDink Email Server  | (Subj:info)  |
| Home of Spaft Utilities | (Subj:copy) for evaluation copy.| for overview.|
+--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--=--+

-!- FLAME v1.1
 ! Origin: Techtalk BBS, Cocoa, FL 407-635-8833 (1:374/1)


 Area: Batch Language Programming                     FI 
  Msg#: 196                                          Date: 17 Nov 94  13:02:00
  From: Graham Green                                 Read: Yes    Replied: No
    To: Michael Ayres                                Mark:
  Subj: Hidden File I Cant Delet

MA>Hi Oliver:

MA> > I have a file called .zip.277

If you haven't already solved the problem, I had a similar problem
however mine was a touch worse with 3000+ files all named with curious
files names.

Solution move any files you wish to keep to a temp dir eg. c:\save, then
use go ol' deltree to delete the offending file and the directory. Once
the file and directory are gone, recreate the directory and move your
good files from c:\save to the new dir.

It worked for me, hope it does the same for you.

Regards...Graham

___
X CmpQwk #UNREGX UNREGISTERED EVALUATION COPY

-!- Maximus/2 2.01wb
 ! Origin: Sydney PC Users Group Mail Exchange (3:712/505)


 Area: Batch Language Programming                     FI 
  Msg#: 195                                          Date: 20 Nov 94  04:08:00
  From: Gary Smith                                   Read: Yes    Replied: No
    To: Francois Thunus                              Mark:
  Subj: dos

FT> Does anybody know if copy returns an errorlevel and if yes which for what ?

COPY, like all other internal commands, does not return an error
level.  Whatever error level was in effect before the copy will
be unchanged afterwards, regardless of whether the copy succeeds
or fails.
-!-
 * OLX 1.53 * Proofread carefully to see if you any words out.

-!- WILDMAIL!/WC v4.10
 ! Origin: The Computer Room-Pickerington, Oh  (1:226/110.0)


 Area: Batch Language Programming                     FI 
  Msg#: 195                                          Date: 23 Nov 94  19:08:00
  From: ROGER SCUDDER                                Read: Yes    Replied: No
    To: JAMES BLISS                                  Mark:
  Subj: %Named Variable%

Hi JAMES,

20-Nov-94 07:31, JAMES BLISS wrote to ALL
          Subject: %Named Variable%

 JB>   Hello!  I was wondering if anyone could help to describe to me the
 JB> uses for the "named parameter" in a batch file.  I understand that they
 JB> make use of the SET command, but I do not see the value of this..If I
 JB> were to SET %variable%=\autoexec.bat, for example, I see no value,
 JB> 'cause I could access this particular file anyway..
 JB>   Maybe I need some help on SET, too, if anyone is willing!
 JB>    Thanks,   Jim


   I will attempt to explain parameters and variables to the
  best of my ability.

    Parameters are often referred to as "run time parameters"
   or "run time arguments". They also may be referred to as
   "parameter variables". They are generally entered at the
   command prompt. When you use a dos utility like copy, the
   filename and destination are parameters. In the command:

                COPY TEXTFILE.TXT A:\TEXT

                         1st        2nd

    the first parameter is the file TEXTFILE.TXT and the second
   is A:\TEXT.
    In a batch file, you use "replaceable parameters". A DOS
   batch file will except up to nine replaceable parameters. If
   the shift command is used the number of parameters is,
   (I believe) in theory unlimited. Replaceable parameters are
   represented as %1 %2 %3 %4 %5 %6 %7 %8 %9. The FOR command
   is another way to use parameters. With FOR you can use %%a
   through %%z.

     Environment Variables are defined with the "set" command.
    DOS uses environment variables to store information about
    the current state of the operating system. To see a list
    of your current environment variables, type SET at the DOS
    prompt.
     Environment variables can be used in a batch file to store
    information until it is needed.

     Here's a simple batch file that uses replaceable parameters
    and environment variables. It is an adaptation of an example
    in the DOS help file.
---------------------------------------------------------------------
 @echo off
 :: MCOPY.BAT
 :: Copies up to nine files to a
 :: directory with one command.
 :: Syntax: mcopy <destination> <filename1> <filename2> <filename...>
 set todir=%1
 :top
 shift
 if "%1"=="" goto end
 copy %1 %todir%
 goto top
 :end
 set todir=
---------------------------------------------------------------------
    Lets say you type this at the DOS prompt:

         mcopy c:\fruit apples.txt oranges.dat pears.exe

    Here's what happens:

    set todir==%1 -creates the environment variable "todir" which
    is the destination directory. In this case it's the directory
    c:\fruit

    shift -subtracts one from all replaceable parameters so
    that %1 becomes %0 and %2 becomes %1 and so on. So %1
    is now apples.txt

    If "%1"=="" goto end -if there is no file to be copied
    end the batch.

    copy %1 %todir% -copies the filename stored in %1 to the
    directory name stored in todir. Note that when you use an
    environment variable in the batch file you enclose it in
    percent signs.

    goto top -repeats the previous commands until there is no
    more files to be copied.

    set todir= clears (destroies) the environment variable
    "todir"

Ŀ
   > from Roger.Scudder@cabin.com

___ Terminate 1.50/Pro
  TerMail/QWK  Alt-X : Not used much in Terminate The Final Terminal


-!- GOMail v2.0r Beta [94-0255]
 ! Origin: The Classic BBS * Upper Darby, PA, (1:273/416)


 Area: Batch Language Programming                     FI 
  Msg#: 194                                          Date: 24 Nov 94  13:35:00
  From: Greg Miskelly                                Read: Yes    Replied: No
    To: Bart Trent                                   Mark:
  Subj: Need bat file!

 -=> Quoting Bart Trent to All <=-

Hi Bart

 BT> Hay everyone, I'm looking for a bat file that will test for the
 BT> existance of: *.zip, *.arj, *.lha files in a certian dir and then if
 BT> found call up a tic prosser and virus scanner..

This Batch will identify .ZIP, .ARJ and .LZH arhives, open them, then
anti-virus check them. It will also identify which of the arhivers
were used to create self extracting .EXE archives, open them properly,
ie, using the archiver instead of executing them, and test them too.
It will also extract and FILE_ID.DIZ files from the archives and
rename the DIZ to FILENAME.DIZ.

It uses F-Prot as the anti-virus tester. F-Prot is a good package and
is free for non commercial use.

-+-+-+-+-+-+-+-+-+-+-+-+-+- cut -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
@echo off
rem    AVGETDIZ.BAT - A Batch File to Anti Virus Check Archives,
rem                   extract the FILE_ID.DIZ file if it exists
rem                   and rename the FILE_ID.DIZ to FILENAME.DIZ

rem    Assumes the Target Files are in directory C:\TARGDIR
rem            the Infected files are kept in C:\BADFILES
rem            the Good Files are moved to C:\OKFILES
rem            the FILE_ID.DIZ files are moved to C:\FILEIDS
rem            the anti-virus software is F-Prot in C:\F-PROT

  echo.
  cd\targdir
  if "%1 == "/? goto help
  if not exist c:\bad\nul md c:\bad
  if not exist c:\tempdir\nul md c:\tempdir
  if not exist c:\okfiles\nul md c:\okfiles
  if "%1 == "/subroutine goto dothebiz
  for %%a in (*.ZIP) do call %0 /subroutine %%a /zip
  for %%a in (*.ARJ) do call %0 /subroutine %%a /arj
  for %%a in (*.LZH) do call %0 /subroutine %%a /lha
  for %%a in (*.EXE) do call %0 /subroutine %%a /exe
  if exist c:\targdir\thelist.bak del c:\targdir\thelist.bak
  goto end

:dothebiz
  if "%3 == "/zip goto dozip
  if "%3 == "/arj goto doarj
  if "%3 == "/lha goto dolha
  if "%3 == "/exe goto doexe

:dozip
  echo 1R.ZIP> %TEMP%\EDIN.BAT
  echo E>> %TEMP%\EDIN.BAT
  echo set DIZNAME=%2>> thelist.bat
  edlin thelist.bat <%TEMP%\EDIN.BAT >nul
  call thelist.bat
  copy %2 c:\tempdir
  cd\tempdir
  :exezip
    pkunzip %2
    if errorlevel 1 echo PKUNZIP could not open %2 >> c:\bad\bad.log
    if errorlevel 1 goto badfiles
    c:\f-prot\f-prot c:\tempdir /all
    if errorlevel 1 echo Possible Virus in %2 >> c:\bad\bad.log
    if errorlevel 1 goto badfiles
    goto okfile

:doarj
  echo 1R.ARJ> %TEMP%\EDIN.BAT
  echo E>> %TEMP%\EDIN.BAT
  echo set DIZNAME=%2>> thelist.bat
  edlin thelist.bat <%TEMP%\EDIN.BAT >nul
  call thelist.bat
  copy %2 c:\tempdir
  cd\tempdir
  :exearj
    arj e %2
    if errorlevel 1 echo ARJ could not open %2 >> c:\bad\bad.log
    if errorlevel 1 goto badfiles
    c:\f-prot\f-prot c:\tempdir /all
    if errorlevel 1 echo Possible Virus in %2 >> c:\bad\bad.log
    if errorlevel 1 goto badfiles
    goto okfile

:dolha
  echo 1R.LZH> %TEMP%\EDIN.BAT
  echo E>> %TEMP%\EDIN.BAT
  echo set DIZNAME=%2>> thelist.bat
  edlin thelist.bat <%TEMP%\EDIN.BAT >nul
  call thelist.bat
  copy %2 c:\tempdir
  cd\tempdir
  :exelha
    lha e %2
    if errorlevel 1 echo LHA could not open %2 >> c:\bad\bad.log
    if errorlevel 1 goto badfiles
    c:\f-prot\f-prot c:\tempdir /all
    if errorlevel 1 echo Possible Virus in %2 >> c:\bad\bad.log
    if errorlevel 1 goto badfiles
    goto okfile

:doexe
  echo 1R.EXE> %TEMP%\EDIN.BAT
  echo E>> %TEMP%\EDIN.BAT
  echo set DIZNAME=%2>> thelist.bat
  edlin thelist.bat <%TEMP%\EDIN.BAT >nul
  call thelist.bat
  copy %2 c:\tempdir
  cd\tempdir

  :testzip
    pkzip -v %2
    if errorlevel 3 goto testarj
    goto exezip
  :testarj
    arj t %2
    if errorlevel 2 goto testlzh
    goto exearj
  :testlzh
    lha t %2
    if errorlevel 2 echo %2 is NOT a self extract >> c:\bad\bad.log
    if errorlevel 2 goto badfiles
    goto exelha

:badfiles
  cd\targdir
  move %2 c:\bad
  goto end

:okfile
  if not exist c:\fileids\nul md c:\fileids
  if exist FILE_ID.DIZ rename FILE_ID.DIZ %dizname%.diz
  if exist %dizname%.diz copy %dizname%.diz c:\fileids
  cd\targdir
  move %2 c:\okfiles
  goto end

:help
  echo AVGETDIZ.BAT Anti Virus Check and Extract FILE_ID.DIZ files
  echo.
  echo Syntax    AVGETDIZ --+

:end
  if exist thelist.bat del thelist.bat
  if exist %TEMP%\EDIN.bat del %TEMP%\EDIN.bat
  if exist c:\tempdir\nul deltree /y c:\tempdir
  set dizname=
-+-+-+-+-+-+-+-+-+-+-+-+-+- cut -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
Hope this helps

Regards

Greg
___ Blue Wave/QWK v2.12

-!- Maximus/2 2.01wb
 ! Origin: The MonuSci BBS (2:255/100)


 Area: Batch Language Programming                     FI 
  Msg#: 183                                          Date: 25 Nov 94  20:41:00
  From: Chad Wagner                                  Read: Yes    Replied: No
    To: Charlie Gabriel                              Mark:
  Subj: XXBUG221

-> Hmmm.... I keep getting errors when trying to decode an XXBUG file
-> over 64K.  Usually the visible processing stops after the header;
-> however, the entire file appears on the screen with errors indicated
-> at the end.

(I don't know if the above is your message or not, I just saw it being
replied to).

Like you said, usually the visible processing stops after the machine
language header, you should see nothing more than that.  You should
never see the xxencoded data block.  One of the reasons you would see it
is because it doesn't have a proper data header, which should look like
this:

*XXBUG20--000026C5--04121993--93229B3B------------------HXBUG102.ZIP

And then following immediately afterwards is the encoded data.  The only
thing that the decoder is looking for is the asterisk '*' to begin
decoding and the asterisk '*' again to end decoding and return control
to debug.

If you still have troubles then try using xxdebug, I posted it here a
few days ago, or FREQ XXBG300.ZIP from your local BFDS site (it has
XXDBG002.ZIP in the archive).

And for anyone interested, XXDEBUG 1.00 is almost finished, I have done
extensive testing on it, and will probably keep it to myself for a few
more weeks.  But it can decode 6 different formats, XXBUG 2.0, XXBUG
3.0, XX34E, xxencode, uuencode, and UUBUG.  It mainly has support for
XX34E, uuencode, and UUBUG added and it supports decoding of XXBUG/UUBUG
multi-paging.  So you should be able to take a multi-paged XXBUG article
and process it, but they have to have used the multi-page feature of the
encoder.


-!- WM v2.09/92-0311
 ! Origin: Silicon Beach BBS 305-474-6512 (1:369/68)


 Area: Batch Language Programming                     FI 
  Msg#: 177                                          Date: 06 Dec 94  03:38:01
  From: Vernon Frazee                                Read: Yes    Replied: No
    To: Lee Gunter                                   Mark:
  Subj: MSDOS v6.n to v6.22

Why Step Up to MS-DOS 6.22? - MS-DOS 6.22 improves on the safety and
ease of use provided by MS-DOS 6.X and is designed for users of MS-DOS
6.X only.

This Readme file contains two parts.  The first part explains what
functionality changes your system undergoes when using the 6.22 Step-Up
depending on the version of MS-DOS 6.X.  The second part describes
features in MS-DOS 6.22 which are incremental to those in MS-DOS 6.0.

If you currently have:
MS-DOS 5.0 or before
   You cannot use the Step-Up. You must have MS-DOS 6.x to use the
   Step-Up to upgrade to MS-DOS 6.22
MS-DOS 6.0
   You'll gain all of the MS-DOS 6.22 features and functionality
   including Data Protection Technology.  You can opt to keep
   DoubleSpace compression or replace it with DriveSpace compression.
MS-DOS 6.2
   You will not gain any incremental functionality other than gaining
   the opportunity to convert your DoubleSpace compressed volume file to
   DriveSpace.
MS-DOS 6.21
   You'll gain the DriveSpace compression technology and all of the rest
   of the features listed below.

Safety Features and Enhancements
* MS-DOS 6.22 includes ScanDisk, that detects, diagnoses, and repairs
  disk errors on uncompressed drives and DriveSpace and DoubleSpace
  compressed drives. ScanDisk can repair file system errors (such as
  crosslinks and lost clusters) and physical disk errors. ScanDisk keeps
  a log of its repairs and enables you to undo any of the changes it
  made. DriveSpace runs ScanDisk to check the reliability of your disk
  before it begins compression. You can also run ScanDisk yourself by
  typing SCANDISK at the command prompt.

* DriveSpace includes DoubleGuard safety checking, which protects your
  data by verifying data integrity before writing to the disk. If
  DoubleGuard detects that the memory DriveSpace is using has been
  written to by another program, it notifies you and recommends you shut
  down your computer immediately to minimize damage to your data.

* The MS-DOS extended-memory manager, HIMEM, automatically tests your
  system's memory when you start your computer. This test can identify
  memory chips that are no longer reliable.  If  you wish to turn off
  the memory test, add the /TESTMEM:OFF switch to the command that
  starts HIMEM.

* Setup now configures SMARTDrive as a read-only cache by default. Even
  if write-caching is enabled, MS-DOS does not display the command
  prompt until SMARTDrive has written its cache to your disk.

* The MOVE,COPY, and XCOPY commands now ask you for confirmation before
  copying a file over another file that has the same name. (These
  commands do not prompt for confirmation before overwriting a file when
  issued from a batch file to maintain compatibility with the large base
  of  MS-DOS batch files.)

Ease-of-Use Features and Other Enhancements
* SMARTDrive now caches CD-ROM drives.

* DriveSpace automatically mounts compressed floppy disks and other
  compressed removable media -- even when Windows is running.

* With MS-DOS 6.22, you can easily uncompress a DriveSpace drive or even
  completely uninstall DriveSpace from memory

* With MS-DOS 6.22, you can easily convert a DoubleSpace drive to
  DriveSpace

* Interactive Start (F8) has been enhanced so you can now bypass or
  carry out individual commands in your AUTOEXEC.BAT. (In MS-DOS 6, this
  capability was limited to your CONFIG.SYS file.) This feature makes it
  easier to troubleshoot your system configuration.

* No-Swap Diskcopy:  The DISKCOPY command now uses your hard disk as an
  interim storage area, which makes copying from one floppy disk to
  another faster and easier.

* Microsoft Defragmenter makes better use of your computer's extended
  memory, so it can now defragment much larger disks and disks
  containing many more files and directories.

* The output of the DIR, MEM, CHKDSK, and FORMAT commands is much easier
  to read, since it now includes thousands separators when displaying
  numbers greater than 999. For example, "1000000 bytes free" now reads
  "1,000,000 bytes free."

    Vernon.Frazee@f71.n135.z1.fidonet.org

 -- SPEED 1.40 #1680:

-!- Olms 2.01b6 [PRSBN46N]
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)


 Area: Batch Language Programming                     FI 
  Msg#: 169                                          Date: 06 Dec 94   8:49:00
  From: Horst Schaeffer                              Read: Yes    Replied: No
    To: John Gray                                    Mark:
  Subj: add files

-=> quoting John Gray to Bruce Dufresne (2 Dec 94) <=-

JG>BD>     How do you add a contents of one file to the contents of
JG>BD>another file without copying the same information that is in
JG>BD>both files.  I would just like to update one file with the newer
JG>BD>contents of a different file.  Both of the files are ascii
JG>BD>files.

JG> Try  COPY  FIRST+SECOND  FIRST
JG> [...]
JG> Whatever happens, it is a DOS requirement that you have to create
JG> a completely new file, with both sets of records in it -- this is
JG> just how ordinary DOS files work, I'm afraid, so you're stuck with
JG> it.

Unless you do this one:

        TYPE SECOND >> FIRST

However, if FIRST has an EOF mark, it will probably not be removed
with old M$-DOS versions (my M$-DOS 5.0 works fine though).

Horst

... Q4FM 2.02 ... Define "definition"!

-!- FM 2.02 / ScanToss
 ! Origin: HS.MUC Germany (2:2480/13.75)


 Area: Batch Language Programming                     FI 
  Msg#: 143                                          Date: 06 Dec 94  12:53:00
  From: Michael Druett                               Read: Yes    Replied: No
    To: Gerry Pajera                                 Mark:
  Subj: Saving Current Directory

G'day Gerry.

What do you think of this.

%COMSPEC%/C echo exit|%COMSPEC%/K prompt @$N:$_@CD $P$_@>%temp%\pop.bat

Using MS-DOS 6.22

Ciao,
Mike.

-!- GEcho 1.00/gamma+
 ! Origin: CLASSIC Rock  -  Sydney, Australia   +61-2-988-3076 (3:711/425)


 Area: Batch Language Programming                     FI 
  Msg#: 158                                          Date: 11 Dec 94  23:52:08
  From: Gerry Pareja                                 Read: Yes    Replied: No
    To: Jim Shaver                                   Mark:
  Subj: RE: current.bat

JS>     I have been following the thread about setting date and time into
JS>the environment with interest.

JS>@echo off
JS>::                      log.bat
JS>call current date
JS>echo Current %1 is: %d_t% >> log.fil
JS>call current time
JS>echo Current %1 is: %d_t% >> log.fil
JS>set d_t=
JS>:END

 I deleted one of your examples to save space.  The above puzzles me.
 You can do the same without an auxiliary bat file at all:

 ver|date|find "Curr">>log.fil
 ver|time|find "Curr">>log.fil

 But, imho, the output is unsightly.

 Here's a neat way to do it; you get a single-line per log entry, which
 would work better should you later wish to process the data with a
 database program (why, it'd be up to the end user...):

 (Up to 9 words may be added at the command line, or as part of a "call"
 batch file command, for comments)


 @echo off
 echo @prompt $d - $t %%1 %%2 %%3 %%4 %%5 %%6 %%7 %%8 %%9>temp.bat
 command /c temp %1 %2 %3 %4 %5 %6 %7 %8 %9|find ":">>logfile.txt
 del temp.bat

 Sample output:

 Fri 11-04-1994 -  9:31:58.60
 Fri 11-04-1994 -  9:32:01.40 Whatever you type here will go in LOGFILE.TXT
 Fri 11-04-1994 -  9:32:42.32 Type whatever you need logged here
 Fri 11-04-1994 -  9:33:08.08 Computer booted in DOS configuration
 Fri 11-04-1994 -  9:33:15.82 Computer booted in plain configuration

 etc.etc.

 Gerry


 * OLX 2.1 TD * G. Pareja * Vancouver * B.C. * Canada *

-!- Maximus 2.02
 ! Origin: VKUG/VPCC Batpower Echo - Richmond, BC (1:153/151)


 Area: Batch Language Programming                     FI 
  Msg#: 176                                          Date: 13 Dec 94  18:52:11
  From: Nels Strand                                  Read: Yes    Replied: No
    To: Michael Sebert                               Mark:
  Subj: Re: Batch File Needed

On 9 Dec 94 04:11pm, Michael Sebert wrote to All:

 MS> Hi

 MS>      Could someone please help come up with a batch file to work with
 MS>      the following programs in this fashion?  Here's the name of the
 MS>      programs I'm working with.
 MS>
 MS>       1) SCANDISK or CHKDISK (both in MS-DOS 6.22)
 MS>       2) CHKFRAG             (PC Mag utility someone gave me)
 MS>       3) DEFRAG              (again in MS-DOS 6.22)
 MS>
 MS> First I want the batch file to accept a drive letter as part of the
 MS> command line and pass that letter along to each of the programs above.
 MS> i.e  MY.BAT C:

 MS> Second I want either scandisk or chkdisk to check for lost clusters,
 MS> crossed directories, etc and give you the opportunity to fix them
 MS> before passing on to the next program.

 MS> Third I'd like chkfrag to to check for percentage of fragmented files
 MS> and run defrag program if the percentage is equal to or greater than
 MS> 5%.  If not the batch file ends. BTW percentage output is the default
 MS> for chkfrag.

 MS> I'll include chkfrags command line switches if it will help.  I don't
 MS> have any documentation for it other than the switch list.

...........................Cut here.........................
::CHECK.BAT - for checking out a disk
@echo off
if (%1)==() goto syntax
scandisk %1
chkfrag %1
if errorlevel 5 goto do_defrag
if errorlevel 0 goto end
:do_defrag
defrag %1
goto end
:syntax
echo.
echo  Incorrect Syntax!  Correct syntax is:  CHECK D:
echo  Where D: is the drive that you wish to be checked.
echo.
:end
...........................Cut here.........................

That should do it..

ķķ  ķ
    ķ
 ĽĽĽ

... Captain! The spell checker kinna take this abuse!
 * Evaluation copy of Silver Xpress. Day # 22
-!- via Silver Xpress V4.02B03 [NR]
 ! Origin: Ducky's 605-393-9626 V.FC (1:293/643)


 Area: Batch Language Programming                     FI 
  Msg#: 174                                          Date: 12 Dec 94  19:51:00
  From: Horst Schaeffer                              Read: Yes    Replied: No
    To: Dana Harding                                 Mark:
  Subj: Redefining keys

-=> quoting Dana Harding to Horst Schaeffer (8 Dec 94) <=-

DH> HS> There are several ways to protect yourself against ANSI bombs:
DH> HS> [..]
DH> HS> (2)  Patch the "p" character in your ANSI.SYS with a different
DH> HS> char. (DEBUG location is hex 161 for german ANSI.SYS, MS-DOS
DH> HS> 5/6.. but should be the same for the english version.) This
DH> HS> way you can still use key redefinitions with your own private
DH> HS> code.

DH>         How could you do that? I know it may seem obvious to you
DH> but to me I don't understand how to do that.

I've been told (hi, John Evans) that the patch location is the same
for german and english MS-DOS versions (5.0,6.xx), so here we go:

Make sure you have a backup copy of your ANSI.SYS, then select your
DOS directory and enter:  DEBUG ANSI.SYS

At the DEBUG prompt (dash sign) you enter:

[1]     E161 <CR> <CR>          DEBUG should display 70 which is the
                                hex value of "p" - IF NOT: GOTO [4]
[2]     E161 "x" <CR>           where "x" is your new private code
[3]     W <CR>                  write the file back to disk
[4]     Q <CR>                  quit DEBUG

Instead of "x" choose any character that is not otherwise used by
ANSI (lower case suggested). The DOS manual says that lower case
f,s,u,m,h,l are occupied (and "p" of course).

After rebooting your system the new code will take effect. In case you
already have key redefinitions in your batch files be sure to change
the coding.

Horst.

... Q4FM 2.02 ... Define "definition"!

-!- FM 2.02 / ScanToss
 ! Origin: HS.MUC Germany (2:2480/13.75)


 Area: Batch Language Programming                     FI 
  Msg#: 195                                          Date: 18 Dec 94  22:18:00
  From: Robert Gladnick                              Read: Yes    Replied: No
    To: Sean Arnott                                  Mark:
  Subj: Date

> I'm sort of new to all this batch file stuff but I was wondering if
> there was a way to set the computer date to a certain day and then run
> the programme and then after the programme has finished reset the date
> to what is originally was?


Here is a batch that I have been using (with a few modifications).

echo. | date > c:\savedate.bat
echo set DATE=%%4 > c:\current.bat
call c:\savedate.bat
del c:\savedate.bat
del c:\current.bat
echo 01-01-1980 | date
rem **********************************
rem ** whatever commands are needed **
rem ** to run your program go here  **
rem **********************************
echo %DATE% | date
set DATE=

-!-
 * OLX 2.1 TD * XT users know that January 1, 1980 was a Tuesday.

-!- QScan v1.14b / 01-0296
 ! Origin: Mushin BBS, Join The InfoMushin Age! 619/452-8137 (1:202/604)


 Area: Batch Language Programming                     FI 
  Msg#: 196                                          Date: 24 Dec 94  16:40:00
  From: Bob Stephan                                  Read: Yes    Replied: No
    To: Chuck Grimsby                                Mark:
  Subj: File Date Batch

In a message dated 12-23-94, Chuck Grimsby said to All:

CG>I'm trying to write one that will verify that the date stamp on a file
CG>matches today's date.  So far, without much luck.  This is on a MS-DOS

Here is a simple solution using my BATch enhancer GET.EXE.  Create this as
a batch files such as FILEDATE.BAT and call it with the name of the file.

Rem Put today's date in the variable TODAY=
get he 14 /vtoday=
Rem Put the file date in the variable GET=
get fe %1 /e /w14
Rem Compare the date strings.
if "%today%"=="%get%" echo The date matches
if not "%today%"=="%get%" echo The date does not match

This feature is available in version 2.61 or later.  Look for GET261,
GET261UP, or GET26UPD on a BBS near you.  This is an update version, so to
get the full documentation also look for GET25.

Season's greetings,
Bob

.. Team GET * bob.stephan@nitelog.com * CI$:72357,2276 * FIDO:1:216/303
-- MR/2


-!- QScan v1.065b
 ! Origin: Nitelog BBS Monterey CA (408) 655-1096 (1:216/303) (1:216/303)



 Area: Batch Language Programming                     FI 
  Msg#: 177                                          Date: 11 Jan 95  05:56:59
  From: Gerry Pareja                                 Read: Yes    Replied: No
    To: Tom Reardon                                  Mark:
  Subj: Useful Commands

TR>C:\#DOS\DOSKEY X=EXIT

 Agreed.  I use this all the time!

TR>C:\#DOS\DOSKEY \=CD\
TR>C:\#DOS\DOSKEY ]=CD ..

 Good ones.  Stolen!

TR>C:\#DOS\DOSKEY $=TYPE C:\#SYS\HEXCHART.TXT |MORE

 Huh?  A Hex chart?  How or why do you use it from the command line?
 Explain pls.

TR>  Also for example when I use a terminal program, the batch
TR>file that IO start it with for example would look something
TR>like this;
TR>CD\
TR>C:\
TR>CD MODEM\PROCOMM
TR>PCPLUS.EXE

 You could streamline this to:

 C:
 CD\MODEM\PROCOMM
 PCPLUS.EXE

 3 lines instead of 4, 25% improvement, hah hah <g>.

 or all on one line:

 for %%z in (C: CD\MODEM\PROCOMM PCPLUS.EXE) do %%z

 (75% improvement)  <g d r>

 Gerry


 * OLX 2.1 TD * G. Pareja * Vancouver * B.C. * Canada *

-!- Maximus 2.02
 ! Origin: VKUG/VPCC Batpower Echo - Richmond, BC (1:153/151)


 Area: Batch Language Programming                     FI 
  Msg#: 115                                          Date: 20 Jan 95  07:44:00
  From: Horst Schaeffer                              Read: Yes    Replied: No
    To: Vernon Frazee                                Mark:
  Subj: Current directory

-=> quoting Vernon Frazee to Phi Nguyen (13 Jan 95) <=-

VF>PN> Why do you want to peel off the drive letter and colon? Aren't
VF>PN> they part of the current directory?

VF>     [...]
VF>     As a simple example, if you're on drive H: in the \FOOBAR
VF>     directory and you need to get to C:\WINDOWS you can't just
VF>     type:

VF>       cd c:\windows

VF>     to do it.  Sooner or later you'll also need a:

VF>       c:

VF>     either before or after, to change to drive C: too.

To change drive you need not extract the drive from the path.
If you have the path %P% for example, just do:

        %P%\
        cd %P%

Works with MS-DOS, Novell DOS (Don't know about 4DOS, PC-DOS).

Horst.

... Q4FM 2.02a ... horst_schaeffer@confusion.fido.de

-!- FM 2.02 / ScanToss
 ! Origin: HS.MUC Germany (2:2480/13.75)


 Area: Batch Language Programming                     FI 
  Msg#: 147                                          Date: 22 Jan 95  03:53:02
  From: Vernon Frazee                                Read: Yes    Replied: No
    To: Per Kristensen                               Mark:
  Subj: Debug

PK> How do I get DEBUG to run with MSDOS 6.22. I have tried SETVER but
PK> NO GO ...

GS> What happens when you try?
PK> [ ... ]

PK> The following screen appears....
PK>   WARNING - Contact your software vendor for information about
PK>   whether a specific program works with MS-DOS version 6.2. It is
PK>   possible that Microsoft has not verified whether the program will
PK>   successfully run if you use the SETVER command to change the
PK>   program version number and version table. If you run the program
PK>   after changing the version table in MS-DOS version 6.2, you may
PK>   lose or corrupt data or introduce system instabilities. Microsoft
PK>   is not responsible for any loss or damage, or for lost or
PK>   corrupted data.
PK>   Version table successfully updated
PK>   The version change will take effect
PK>   the next time you restart your system
PK> but when I write debug I get a "incorrect DOS-version".

    And when you type:

      VER

    at the DOS

      C:\>

    prompt, what is the exact response?  If your system booted with a
    valid (read: correctly installed) version of MS-DOS version 6.22,
    the response should be:

      MS-DOS Version 6.22

    If it's returning the response:

      MS-DOS Version 6.20

    or

      MS-DOS Version 6.21

    and you try to load the DEBUG.EXE program from MS-DOS version 6.22,
    you'll get the error:

      Incorrect DOS version

    If this is what's happening (you're booting with v6.20 or 6.21 and
    are trying to run DEBUG v6.22), download the following two files
    (available free except for whatever long-distance charges) from
    Microsoft's Download Service at (206) 936-6735:

      STEPUP.EXE   2552585 6-22-94  7:20p - Upgrade from 6.nn to 6.22
      SUP622 .EXE   781125 6-29-94 11:12a - v6.22 Supplemental Disk

    Create a directory on drive C: named say C:\XXX and put a copy of
    both of the above files in it.  Change into C:\XXX and type:

      STEPUP

    After the five files self-extract, type:

      SETUP

    and follow the on-screen instructions.  When SETUP is done and your
    system has rebooted, change back into C:\XXX and type:

      SUP622

    When it asks you if you want to overwrite SETUP.BAT, answer

      Y

    Now type:

      SETUP

    again and follow the on-screen prompts.  (This one doesn't take as
    long).  When it's done, type the following two commands from the
    "C:\>" (root directory) prompt to clean up:

      DELTREE C:\XXX
      DELTREE C:\STEPUP

    You'll also probably want to remove the following line that DOS just
    added to the end of your AUTOEXEC.BAT file:

      PATH=C:\DOS

    so that your PATH statement will again be the one in effect.

    Vernon.Frazee@f71.n135.z1.fidonet.org

 -- SPEED 1.40 #1680:

-!- Olms 2.02.b3 [PRSBN46N]
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)


 Area: Batch Language Programming                     FI 
  Msg#: 194                                          Date: 24 Jan 95  22:15:47
  From: Gerry Pareja                                 Read: Yes    Replied: No
    To: Donny Brooks                                 Mark:
  Subj: Que Pasa! Ya'll

DB>   lurk in the darkness of this Echo. My goal is to be one of the
DB>   BATch guru's, who answer rather than ask so many of these questions.

 A laudable goal, I will concur!

DB>   Dir/s | find "01-17-95"

DB>   and did nothing! I Ctrl-C out of there, went to my autoexec.bat and ::
DB>   the "Set Dircmd=/P/O:GN" statement, rebooted and typed again the
DB>   command, bingo it worked, every file made on that day was listed.

 Yep, you found that out, huh?  <g>

 I can suggest a couple of things:

 add a "/-p" to the above, like this:

 Dir/s/-p | find "01-17-95"

DB>   I'd like to keep this command in, <I like the neatness of having the
DB>   "Dir's" and filnames alfa-numerically listed.> I of course take refuge

 Here's another suggestion: make up a couple of short batch files or
 DOSKEY macros:

 ::DIRPAUSE.BAT
 Set Dircmd=/P/O:GN

 ::DIRNOPAU.BAT
 Set Dircmd=/O:GN

 You can type them as needed at the Dos prompt, or within batch files,
 use a "call":

 call dirnopau
 :: do something here that requires no pauses
 call dirpause

 The more universal way of handling the situation is:

 set olddir=%dircmd%
 set dircmd=
 :: do something here that requires no pauses
 set dircmd=%olddir%
 set olddir=

 this way you (as the programmer) don't even have to know what the
 DIRCMD settings are; DOS will "remember" your old settings and re-set
 them when you are done with the procedure.

 Gerry

 P.S.: None of the above require re-booting.  DIRCMD can be set, re-set
 and un-set from the command line or any batch file. There's no magic to
 it.


 * OLX 2.1 TD * G. Pareja * Vancouver * B.C. * Canada *

-!- Maximus 2.02
 ! Origin: VKUG/VPCC Batpower Echo - Richmond, BC (1:153/151)


 Area: Batch Language Programming                     FI 
  Msg#: 197                                          Date: 26 Jan 95  07:26:12
  From: Peter Lovell                                 Read: Yes    Replied: No
    To: Tony Lundberg                                Mark:
  Subj: Help....

 TL> Could someone please tell me how I can get a batch file to
 TL> delete a same named file on a whole disk.

 Hi Tony,

 The following works for me, perhaps it might work for you.

     @echo off
     pkzip -rP -e0m dummy c:\chklist.ms > nul
     del dummy.zip

 Later     o
        _ /-_
  .....(_)>(_)   Peter L.

-!- Maximus 2.02
 ! Origin: Diagnostic BBS * Brisbane-Qld-Australia * (3:640/302)


 Area: Batch Language Programming                     FI 
  Msg#: 187                                          Date: 28 Jan 95  01:03:34
  From: Mark J. Allen                                Read: Yes    Replied: No
    To: Horst Schaeffer                              Mark:
  Subj: Re: Current directory

 -=> Quoting Horst Schaeffer to Vernon Frazee <=-

 -=> quoting Vernon Frazee to Phi Nguyen (13 Jan 95) <=-

 VF>PN> Why do you want to peel off the drive letter and colon? Aren't
 VF>PN> they part of the current directory?

 VF>     [...]
 VF>     As a simple example, if you're on drive H: in the \FOOBAR
 VF>     directory and you need to get to C:\WINDOWS you can't just
 VF>     type:
 VF>       cd c:\windows

 HS> To change drive you need not extract the drive from the path.
 HS> If you have the path %P% for example, just do:

 HS> %P%\
 HS> cd %P%

 HS> Works with MS-DOS, Novell DOS (Don't know about 4DOS, PC-DOS).

 Hi Horst, That trailing backslash certainly does the business -
 I've always stripped the D: never thinking that the simple addition
 of a backslash would save lines of code.

 I've never seen this before but can confirm that it works flawlessly
 with MS-DOS v5.01a.

 Gary C (T1'nNB) I hope you caught this, mate! This definitely deserves
 ~~~~~~~~~~~~~~~ inclusion in the MUF. ( hows v17 coming on ? )

 Cheers, Horst.

... >FidoNet:Mark J. Allen@3:690/660 <> InterNet:markalln@omen.it.com.au<
-!- Blue Wave/Max v2.12 [NR]
 ! Origin: The Perth Omen. Western Australia's First BBS (3:690/660)


 Area: Batch Language Programming                     FI 
  Msg#: 159                                          Date: 30 Jan 95  19:34:42
  From: Andrew Kennedy                               Read: Yes    Replied: No
    To: Willy Verhegge                               Mark:
  Subj: PC REBOOT

   Put the line below in a file named BOOT.COM to get the smallest possible
   file that will cold boot a computer. First symbol is an Alt 240 followed
   by (4) Alt 234 characters made on the NUMERIC keyboard.

   
             Andy


___ Blue Wave/QWK v2.12

-!- TMail v1.31.5
 ! Origin: The Bit Bucket BBS * bitbucket.com * 713-496-9670 * (1:106/9670)


 Area: Batch Language Programming                     FI 
  Msg#: 171                                          Date: 29 Jan 95  00:38:00
  From: Mark Livingston                              Read: Yes    Replied: No
    To: Vernon Frazee                                Mark:
  Subj: Quick Format

  In our last episode of Quick Format, we heard Vernon say to Mark...

 ML> Why use ren/? piped into format? (Just gotta know!)

 VF> Even with the quick (/q), unconditional (/u), and volume_label
 VF> (/v) parameters specified, FORMAT _still_ pauses for input at
 VF> two prompts.  The first happens as soon as you press [Enter]
 VF> at the end of the above command and looks like so:

                -<abbreviated only for bandwidth>-

 VF> Therefore, to avoid the two FORMAT prompts/pauses all you
 VF> really need to do is "pipe" ("|") the output of 'REN/?'
 VF> command to the 'FORMAT A:/Q/U/V:""' command.  Like so:

 VF> ren/?|format a:/q/u/v:""

 VF> Cool eh?  <g>

I looked at the help screen for REN. I guess it just takes the first
<CR> and the first instance of the letter "n" that appears in the
screen output?

Yeah, pretty cool. :)  Thanks



    Mark ---
                    netmail: 1:107/432
                    internet: mark.livingston@skyhawk.metronj.org

... I'll have what the gentleman on the floor is having.

 * TLX v4.10 (Registered) *
___ Blue Wave/QWK v2.12

-!- WILDMAIL!/WC v4.00
 ! Origin: Geno's Place BBS  (1:107/638.0)


 Area: Batch Language Programming                     FI 
  Msg#: 200                                          Date: 30 Jan 95  12:02:00
  From: Peter Lovell                                 Read: Yes    Replied: No
    To: Ross Boys                                    Mark:
  Subj: Muf16

 RB> Peter, I have a copy. I could upload to your BBS if necessary.

 Thanks, Ross, for the offer, but Mark J. Allen of 3:690/660
 has offered to net mail it to me so I'm expecting it any day now.

 I'll let you know when/if it comes through.

 RB> Regards Ross.

 Later     o
        _ /-_
  .....(_)>(_)   Peter L.

-!- Maximus 2.02
 ! Origin: Diagnostic BBS * Brisbane-Qld-Australia * (3:640/302)


 Area: Batch Language Programming                     FI 
  Msg#: 200             Local                        Date: 04 Feb 95  01:04:32
  From: Bat Lang                                     Read: Yes    Replied: No
    To: Gabriel Stevens                              Mark:
  Subj: Compression of hard drive.

 -=> Quoting Gabriel Stevens to All, {02 Feb 95  19:57:09} <=-

 GS> I need help.  does anyone have any knowledge about trying to
 GS> decompress the hard drive.  I compressed it, but was not aware that it
 GS> would take up substantial amount of conventional memory.  please
 GS> advise. -!- FreeMail 1.09

Gabriel, this is not the right place to be asking this.  Suggest one of
the TECH echoes.  Here are three from the backbone.  Ask your Sysop for:

DR_DEBUG            Doctor Debug's Laboratory
HDCONF              Hard Drive CONFerence
TECH                Technical Computer & Miscellaneous Discussion

Good Modeming!  /\oo/\

... Fido NetMail: 1:382/1201, or Internet: bat@infomail.com
-!- Blue Wave/Max v2.12
 ! Origin: The HUB * Austin TX * Centex PCUG * 512-346-1852 (1:382/1201)


 Area: Batch Language Programming                     FI 
  Msg#: 199             Local                        Date: 05 Feb 95  23:10:33
  From: Bat Lang                                     Read: Yes    Replied: No
    To: All                                          Mark:
  Subj: LOGTRIM V1.3

On the 28th of Dec I posted a msg here under: Util wanted.  The
requirement was for a logfile trimmer that would read consecutive lines
from an ASCII text file (lines of logfiles) and trim their sizes in
accord with the parameters found for each.

The only substantive reply came from Horst Schaeffer, in GE.  Since that
time, I have been coordinating ideas with Horst, and tonite the final
product arrived via I-net.  I now have the honor of introducing the
fruit of this coordination, LogTrim v1.3.

This file will act on any logfile from a command line, or on all your
logfiles if they are entered one per line in a loglist, and that is
identified by an @ symbol before the name of the loglist.  Simply define
the maxKb that you wish each file to reach, and LOGTRIM will either
reduce it by deleting the older 50%, or reduce it to a desired size with
the minKb that you specify.  A full .DOC file is included, from which:

> LOGTRIM Ver 1.3 (c) 1995, Horst Schaeffer
> -----------------------------------------
>
> LOGTRIM keeps the size of logfiles within a given range (kilobytes).
> Files are always cut at the beginning of a line. The optional string
> is used to identify the beginning of a log section for proper cutting.
>
> Syntax:    LOGTRIM logfile minKB maxKB ["string"]
>            --------------------------------------
> Example:   LOGTRIM fd.log  200 160 "--------"

----------------------------->CUT HERE<-----------------------------
 NLOGTRM13.LZH
 e100 FC 2B ED BE 7E 1 B9 2 FE 2B DB 89 F2 B4 3F CD "!r\P"89 F3 89 C1
 e118 AC "<*"E0 FB "uC<"A AC 75 FB E8 27 0 2A F6 1 D5 FE C6 B1 4 AC 3C
 e131 " v"EB E8 17 0 2 D2 2 D2 B5 6 D1 E2 73 5 88 "7C"B6 1 FE CD 75 F3
 e14A E2 E3 EB DF 8A D0 BF 73 1 2 55 FF 2A 15 72 7 AE 72 4 AE 73 F3 C3
 e161 "XZ"B9 FF FF F7 DA B8 1 "B+"DB CD 21 89 E9 CC 0 "+,-.0:A[a{"FF
 g=100
 w17E
 q  XDS 1.2 by Horst Schaeffer
*XXBUG300000086305021995F75E9E0D184820------------------LOGTRM13.LZH
n73chP4Up9Ss0++-T+k++cop25W+-0olDFpFGGIoiEoxBLZ3B+++0hqeX3XHQ7zrRn7Lf
n7GM9X+jVzoC0pNRKolUmnfOeVph3NOBdqAInVoSPMNYZCbyKy0y-EM3yxseLornFFg9C
n0mGZKGwaqT-lhPEpET1gvkx9qIiXUtmaYzmhBPk4PHeZP-9-VRPdcDTQrgsTL-5ldIeK
n7-JH4lo7TRIZ6Le4CdYrGd6J3JNOe4Kf636ZRg6dDREm74GcUBq7IWOpAs4T+n8rCyfp
nH5vimNJGQqaR326hyBHo1FyoYKJloPcHx5a0AbCSyBD-CNLGBwtk3oroLqH61itBe0ze
n9ySIKCeCjeTUP2qAwfCe0ULU3XA-nQGqRgTvNbTgb0AXCCgoDrfSM-ApDVAR-cyNOI7h
nOW+OL4Lpu7Rz2pcbfODWdZf4FIUNNSunHB8WOn09FujsXGCSjl2nPSAycZLuy9laXxHP
nt6xuY-hXd2-GWjHW1enneyYClz7XTpqTgiDv5LLlHa9oZqPHqyGEGEhk19sRKPIKqKCW
noSw-7z8jmS9gLl69ITh7i42rceSoMlOh5vfB1bBwU3DrQ2h4nVB5o6R6-KdwVLuiH65Z
n0kKoSDSSiHo8yZbP0nqdav+XS9Ez08kyA8zpaavkMRnmBy4kDqNznM4RupWy50Naw3PP
ns406iPgNhCl3g0zFTLyB9+7GKTfgydjtE+ixSMJseE1LTs4Y+ONOv9o7corl4AzwcXmV
n4ckpcGLUpR3407zSOfncTt4iOYtboTQPdtcC3xWKnIPdMmhqf8BuhS7ByzzdsLafJVOP
nVeyiCjG-0SI2XRfpb9+rGjmckHh0TPHbjLbgrjcb2q2GcFpWBcrPqJPFBgulWwGSNhU-
nKIw6Krx2UbT7hbG3Rl489r6r7CBJgxkeeAMLXA8ODUb6TC2GgWH7Ilo67lCSbNlCfVVS
ntV-Ym7K1TVYsrS7yxe5A63ZRi5xg2uCg6DreN2hJECH6Z8-mt+is5sLs7mOWcSTnTc1m
nsxk5brRrxDA1p7OgkESl5vaAdYN0We+YYGpgO1Ih8+I++As9+++UHoES6+29H2x5J377
nHGt2HoBTLIo+++FSOhilhhmPtq1yzknMeR53579PRLUlBNPBcOqmYYAMBQMtdSHT2tRm
nrRmXXrsprsbxviGGYJZaadUkPtvj1rrpXOOrgtTkuCPYxcTa9ErdS+77gcPrcx5Zn-y9
n4iS5DBfEB3+hlshnuTgS95WhWzG6pC-ygEQbyF-Z+8NecGcL-gGzKZM61Ibe3MBEjI6G
nR8JAovLWv99XlQQCEVcUVKl4pkHJj-1sEzGCd8pdLeC86-GJX85ELcNIx93cI1bh9rMw
nGL-KsNkSk2nWhuOBjnU9BEC4Mys314VIpZF+eImSL1ZCpSTOhuCjE-TfPUggs8Ifz9oV
nGXf9zDut6nf7yqD23zvu-vuyh3BGVoRYZcbZCbUrwyQBvnNkmKwr6R9LxkDSVe8FS9LO
n1xBZCb0jQLbCu6JOE33IB6GHh6TAkJ6Tfi1Ultv8qsobUEK+vIH349M4ucNUdf9p9MwV
n917kt+YQ7WidanjUWfA+XteYodSAw-HU4I-GAjGCfMZGXVuq+W74dcUJx3o16oMnHOlQ
nwFoyAit8CnazR5UtXUWm-O-JFaBoKhaXFbfaXVL1XMFKGn5v11VMxPsMytHgrgtdt3jq
nA1eEegglOIPHY-VgaV7G6wypvEMqQKxxSgKcjIgMxovkiv-qCZoOlO7PBEem3ksEJ-Up
n17KQO2JeSsyFfEe6alX-K-s-xlAddEKVZF5awY-mpy6of0kXar+Dt9QAgl1GjIEXZdjC
nmjGLzDwJgDQL09qtbEfhkcPBfVfJ2VXlaNBBKpcfaVHI9chr4vG6cOmaCsPFFoVIl8rZ
nQlND3S70rdqljf9+-PoBQ69UMnxO6aB9r4BmF0uB0VAVRaRp18mXJWMZxUPqTuwCwmDS
nOB82kZNsrNiq7F2AnWHeKlhUmgfTJKz-4eNWmYR9fghJbiYRk7LCaN-1Q4ExpeFbmMI6
nKc3adKl-Rt5G8sGEf84CV+SvhphhHI8YmI1g3-VKCFJ6RoV69KYKp9hKK25t3Y11c3Zg
nOKv7s1BXHoCH4gbXHIle4vMut3Orp5yZuDPvnoRlscV63Ublk66pYh7NJXRgcSYGkh2X
ncI7f7lkTWfwJdUuhd51+mHU14d6s0M6BHe8-nnls5fGtvcJlundpExEeo-bW-3uClK6u
niOMLCcfIEyagcTck3c-Isl1W0AZ7Qp4e8-S0n5A87nf8etO+6NW6VH7wnXAIGqaGIai6
n5KFj8DfrM0671NHa29u7sLBT2QS8EwkH8m0G3gVWv--UXzKlS2dScUJzxez1qP69JqRM
n71o5998366TiC9Af8S5pmg-s4T34HbeFAP3XxUZHhbIVaRQmxSXhqRTqcuvprB+SEDYZ
nvQs5+-GGw9yOKREVi-qpBTegGRWsuuqCxKyArFD-9vtVPRv+sh5kf94XsKz1dZIT8jXZ
ncOK2VqevuDUI41UnYzE5WMjlT9qwTe9yGbkzwy+HsQjctjjxruEu4xbnSPBYzcjoDUNy
nm+BCSVgBGH-U1LmdHAlFNyGTP3HghgrvPF66wPocmIMD6hl1EYo2z5+w6e9TxwODBMcQ
nM7Aczhs0mDV7hNL-nB2wwRtzJmwIDVPuvV-lsXMw46fRuFAB66czNfWR9suYkXD5tDg6
nLQxza1HKyztLA8E91RdB89WahiaX9ixmP-6LRH2nZGPb5BdoDF0Wj44TTrAz-i5wosgS
nivtdyMCDYxL84zcrz7xaTRri0LnyLscfanogVPK7A0unvbvihvb1Jtz98P-pPWGDZcHC
3mKQar+0D
*XXBUG Version 3.00 by Chad Wagner
----------------------------->CUT HERE<-----------------------------
 If you have downloaded this script file, remove any captured
 communications header and then enter

  DEBUG < filename

 where filename is the name of this script file.

Good Modeming!  /\oo/\

... Fido NetMail: 1:382/1201, or Internet: bat@infomail.com
-!- Blue Wave/Max v2.12
 ! Origin: The HUB * Austin TX * Centex PCUG * 512-346-1852 (1:382/1201)


 Area: Batch Language Programming                     FI 
  Msg#: 142                                          Date: 03 Feb 95  21:14:00
  From: Ingo Kley                                    Read: Yes    Replied: No
    To: Shawn Oatley                                 Mark:
  Subj: Compare

 > Is there any way to take a file, and compare it to another file.  I want
 > to be able to check the dates and if they are different, exit with an
 > errorlevel or something.  Will DOS' COMP do it?

Yes; using the following batch

===================FILDATCO.BAT=======================
@ECHO OFF
DIR %1 /-w /-p /-b                        >  MAKE.BAT
DIR MAKE.BAT /-w /-p /-b | FIND /I "MAKE" >  DO.BAT
ECHO SET FIRSDATE=%%3                     >  MAKE.BAT
CALL DO
DIR %2 /-w /-p /-b                        >  MAKE.BAT
DIR MAKE.BAT /-w /-p /-b | FIND /I "MAKE" >  DO.BAT
ECHO SET SECODATE=%%3                     >  MAKE.BAT
CALL DO
FOR %%D in (MAKE DO) DO DEL %%D.BAT
IF %FIRSDATE%==%SECODATE% GOTO EAVEN
GOTO DIFF

:EAVEN
  ECHO %1 and %2 have the same date
GOTO END

:DIFF
  ECHO %1 and %2 have different dates
GOTO END

:END
  FOR %%D IN (FIRSDATE SECODATE) DO SET %%D=
============================================================

SYNTAX=             FILDATCO  FILE1   FILE2


bis denne und Tschoe  Ingo

-!-
 ! Origin: ** Equal goes it loose ** (2:243/6151.21)


 Area: Batch Language Programming                     FI 
  Msg#: 200             Local                        Date: 09 Feb 95  01:15:45
  From: Bat Lang                                     Read: Yes    Replied: No
    To: Montgomery Hounchell                         Mark:
  Subj: Batch File Creating

 -=> Quoting Montgomery Hounchell to All, {07 Feb 95  06:39:45} <=-

 MH> I have been lurking here for months.  I want to learn Batch file
 MH> making.  I have two Dos books, one of them has two chapters and the
                [... text deleted for brevity ...]

 MH> Could you all give me some book titles which I might be able to order?

The problem with most of the books that many of us recommend, are
written at the DOS 5 level or earlier.  I know of none I could recommend
that are current, say to DOS 6.2.

Nonetheless, my favorite Batch author is Dan Gookin, and here's the best
one he wrote IMHO:

Advanced MS-DOS Batch File Programming, by Dan Gookin
Published in softcover by Windcrest Books, List price: $24.95 US
ISBN 0-8306-9197-9  ISBN 0-8306-3197-6 (pbk)

I believe the first # is hard cover, since mine bears the second # and
is the soft cover.  But the publisher's page carries both.

BTW, it was not much trouble, since I simply had to lay my hands on my
own copy.  {^; I trust this will serve you to order it.  Good reading,
and Good Modeming!  /\oo/\

BTW, just keep lurking here, since if the Gookin book is college level
batch programming, then this echo is post grad school.  {^;

... Fido NetMail: 1:382/1201, or Internet: bat@infomail.com
-!- Blue Wave/Max v2.12
 ! Origin: The HUB * Austin TX * Centex PCUG * 512-346-1852 (1:382/1201)


 Area: Batch Language Programming                     FI 
  Msg#: 179                                          Date: 07 Feb 95  11:16:02
  From: Peter Lovell                                 Read: Yes    Replied: No
    To: Jim Shaver                                   Mark:
  Subj: nowset.com

     -=> Quoting Jim Shaver to David Adamson on 30 Jan '95 <=-

 G'day Jim,

 [ ... ]
 JS> I like this little file you posted but found I wanted "@" signs
 JS> before the SET commands so I would not need an " @echo off" in
 JS> the batch file that was created with  "nowset > now.bat"    So:

 JS>  ----------------------------[ CUT HERE ]------------------------
 JS> nNOWSET.COM
 [ ... ]

 If the created file "now.bat" is called from within the batch file
 that created it, then there's no need to worry about the "@" or the
 "@echo off" as the status of echo is passed on to the called batch
 file.  If "now.bat" is to be run later as a stand-alone the omitting
 of a starting "@echo off" in favor of each line starting with "@"
 will result in the display of an additional prompt to the screen
 when the final CR/LF is encountered.

 I have found this to be the case with MS-DOS 5.00 and above, and
 once realizing it edited all my batch files appropriately.

 Later     o
        _ /-_
  .....(_)>(_)   Peter L.

-!- Maximus 2.02
 ! Origin: Diagnostic BBS * Brisbane-Qld-Australia * (3:640/302)


 Area: Batch Language Programming                     FI 
  Msg#: 185                                          Date: 03 Feb 95  01:00:00
  From: Bat Lang                                     Read: Yes    Replied: No
    To: Rodney Richison                              Mark:
  Subj: Decimal values

MSGID: 1:382/1201.0 2f31ee20
 -=> Quoting Rodney Richison to all, {01 Feb 95  06:55:12} <=-

 RR> Anybody got a chart of decimal values for the keyboard so I can use
 RR> stuffkey in my batch files? like 13=enter or 32=space etc..? Or tell
 RR> me where to find such? Thanks!

Rodney, if it's an ASCII chart you are seeking, I have a 49 line script of a
dandy that I could post if you request it of *me*.  Since you addressed it to
All, no scripts should be forthcoming, (else 4 or 5 might respond).  Waiting
for your reply, and Good Modeming!  /\oo/\

... Fido NetMail: 1:382/1201, or Internet: bat@infomail.com
-!- Blue Wave/Max v2.12
 ! Origin: The HUB * Austin TX * Centex PCUG * 512-346-1852 (1:382/1201)
SEEN-BY: 105/42 621/201 622/410 623/630 624/50 632/301 341 348 635/503 SEEN-BY:
640/820 690/660 711/401 409 410 413 414 420 423 430 807 808 809 915 SEEN-BY:
711/924 927 950 712/407 515 623 628 704 713/888 714/906 800/1 PATH: 382/1201 41
92 3615/50 105/103 42 712/515 711/808 413 409 632/348


 Area: Batch Language Programming                     FI 
  Msg#: 309                                          Date: 13 Feb 95  10:33:00
  From: William Lipp                                 Read: Yes    Replied: No
    To: Trevor Johnson                               Mark:
  Subj: Re: find current dir

 -=> Quoting Trevor Johnson to Mark J. Allen <=-

TJ> Does any one know a pure DOS method to detect the current
TJ> directory....?

MJA> The command  CD>filename.ext will put it in a file.

TJ> Will this work into a variable...?

Gerry Pareja, one of the resident gurus here, taught me how to redirect
the command prompt to accomplish tricks in batch files.  You can customize
your command prompt to include information about the current drive,
directory, time, date, ">", "<", "|", "=", etc.  The idea is to create
a "magic prompt" that reads like a batch file, then get it into a batch
file.  And it doesn't even change your "real" prompt!  It takes three steps.

STEP 1:

  echo @prompt PromptString > temp1.bat

     Now temp1.bat has one line, a prompt command.  Pick the
     PromptString to write the "magic prompt" that you need.  Some
     examples and the prompt they create are:

     @prompt $n:$_CD $p            D:
                                   CD D:\BBS\BWAVE

     @prompt SET CURR$Q$p          SET CURR=D:\BBS\BWAVE

     You might want to issue these prompt commands interactively
     (without @) to better understand how this works.

STEP 2:

  command /C temp1.bat > temp2.bat

     Now temp2.bat has 2 or more lines.  The first line is blank.
     The other lines contain the magic prompt we composed in step one.
     We have turned the prompt into a real batch file!

STEP 3:

  call temp2.bat

     This uses the batch file.

Notes:
  For a complete implementation you may want to erase the work files.
  For speed you might put the work files onto a RAM disk.  For some
  purposes you might want to insert additional work between steps two
  and three.  If those additional steps change the current directory,
  then you need to know where "temp2.bat" was created - perhaps as
  %TEMP%\temp2.bat.

(Revised 6 Dec 1994.  Posted 3 times.  Last posted 6 Dec 1994)


-!-
* LAKOTA v1.4
-!- FreeMail & Blue Wave/QWK v2.10
 ! Origin: * Glass Onion * Ansonia CT * USA * 203 732-5746 * (1:141/1295)


 Area: Batch Language Programming                     FI 
  Msg#: 405                                          Date: 15 Feb 95  14:03:00
  From: Gary Smith                                   Read: Yes    Replied: No
    To: Mark J. Allen                                Mark:
  Subj: Re: MUF v1.6 FOR..IN..DO

MJA>  Bill George's point is a valid inclusion, I believe, because GOTO's in
   >  a FOR IN DO statement do not work the same way that other FOR IN DO's
   >  do. The FOR IN DO is only processed until the first GOTO is executed,
   >  and does not repeat for all members of the 'IN (set)' in the same way
   >  that MS-DOS treats other FOR IN DO loops (i.e. it doesn't.(loop))

That's not quite it either.  The FOR IN DO actually processes
each GOTO, including checking the validity of the target label,
but it doesn't transfer control until the last entry is processed.
Running the following little TEST.BAT can be enlightening.  (Do
not turn ECHO off.)

for %%n in (1 2 3) do goto label_%%n
echo Fell through!
goto end
:label_1
echo Hit label 1
goto end
:label_2
echo Hit label 2
goto end
:label_3
echo Hit label 3
: end
-!-
 * OLX 1.53 * Behind each "Have a nice day" is a "Go **** yourself!"

-!- WILDMAIL!/WC v4.12
 ! Origin: The Computer Room-Pickerington, Oh  (1:226/110.0)


 Area: Batch Language Programming                     FI 
  Msg#: 420                                          Date: 14 Feb 95  19:03:44
  From: Santiago del Pino                            Read: Yes    Replied: No
    To: Montgomery Hounchell                         Mark:
  Subj: Batch File Creating

Hi, Montgomery Hounchell, how are you?

07-Feb-95 06:39, Montgomery Hounchell wrote to All
          Subject: Batch File Creating

 MH> I have been lurking here for months.  I want to learn Batch file
 MH> making.  I have two Dos books, one of them has two chapters and the
 MH> other has three chapters on how to create Batch files.
 MH> I have been reading and attempting to learn from them.  But I have
 MH> noticed you all have much more knowledge on it.
 MH> You all use more syntax's than both of my books describe.
 MH> I would sure appreciate some advice on how I can learn what you all
 MH> know.
 MH> I live near a very small town.  There isn't a book store within forty
 MH> miles.  I went to the nearest book store last week, and they did "not"
 MH> have any books on Batch file making..
 MH> The lady there said I could order some, but I would have to know the
 MH> names of the books.. I don't know of any titles.
 MH> Thus I am in between a rock and a hard place.  And there ain't no
 MH> relief in sight. :-)
 MH> Could you all give me some book titles which I might be able to order?
 MH> Or could I post questions here, and have some of you all help me to
 MH> learn?
 MH> I have Norton's Utilities ver.  8.0 which has Ndos, (I have been
 MH> looking at it) and it looks like a good command.com for fooling with
 MH> batch files.
 MH> Do you all recommend the Ndos for a beginner like me?
 MH> I beleive I need to learn those syntax's you all use.  How do I find
 MH> those listed?
 MH> I think you all do some real good batch files.  I don't understand
 MH> what you all put in them, but they sure look good.
 MH> Do I have to learn programming in order to create batch file?
 MH> I hope not, I don't think I have the ability to do that.
 MH> (but I would try)
 MH> Thanks for any comments.

Please find enclosed the answer I sent to a similar message a few weeks
ago. There were one or two more answers, but I don't keep them.

I hope this helps.

*************************************************************************
Hi, Aaron Curtis, how are you?

14-Jan-95 21:18, Aaron Curtis wrote to All
          Subject: Batch Tutor

 AC> Greetings everyone.  I have been following the messages in this
 AC> conference for several weeks now and have even tried a few of the com
 AC> programs.  (My favorite was LEDS)  I have novice experience with batch
 AC> files and can make very simple ones.  (They change directory, load a
 AC> program, and when I exit, it goes back to the root directory)  But I
 AC> found it very hard to follow many of the batch files posted here.  Does
 AC> anybody know of a tutor for batch files that is written so that the
 AC> novice can understand?  I would also like to learn how to use debug.
 AC> Thanks in advance.

I am exactly in the same situation than you: very far from being an
expert but amazed at how much one can learn by just reading the messages
all these guys write to each other.

As to the book you want, I would advise you this one:

              "Harnessing DOS 6.0 - Batch file and command macro power"
              Craig Menefee and Nick Anis
              Bantam books, 1993

It will provide you with an excellent background to take advantage of
all the know-how you can get in this echo.

Another one which I find remarkable is:

                "DOS 6 - Techniques & utilities"
                Jeff Prosise (PC Magazine)
                Ziff-Davis Press, 1993

Lots of information although not focused in batch files exclusively.

Maybe others will prefer different books, I don't know that many, but
I find these two very useful indeed.
*********************************************************************
Ŀ
   > Greetings from Santiago del Pino

-!- Terminate 1.50/Pro
 ! Origin: Point 2:291/756.6 at Gemini/2 BBS (2:291/756.6)


 Area: Batch Language Programming                     FI 
  Msg#: 417                                          Date: 17 Feb 95  23:40:00
  From: William Lipp                                 Read: Yes    Replied: No
    To: Bob Browar                                   Mark:
  Subj: Re: monthly batch

 -=> Quoting Bob Browar to William Lipp <=-
-=> Quoting  Gerry Pareja:

WL>GP> echo.|date|find "-17-">temp
WL>GP> copy temp+,,>nul
WL>GP> if exist temp echo Yep, it's the 17th!

BB> As long as the first line creates a file and the
BB> third line tests for it, why bother to copy it in the second line?

The first line always creates a file.  If nothing was found, it will
be a zero length file.  Checking if that file exists would always find
it.  The second line is supposed to make a zero length file go away,
but keep any longer file.  So testing on the third line now tells me
if the created file was zero bytes.

-!- Blue Wave/QWK v2.10
* LAKOTA v1.4
-!- Alexi/Mail 2.02b (#33)
 ! Origin: Glass Onion * Ansonia CT * USA * Are you an onionhead? (1:141/1295)


 Area: Batch Language Programming                     FI 
  Msg#: 361                                          Date: 23 Feb 95  18:53:00
  From: Vernon Frazee                                Read: Yes    Replied: No
    To: Bob Browar                                   Mark:
  Subj: .. & .

VF> d) Even handier but possibly disastrous, the following command
VF>    will not only delete all the directories of, but of all the
VF>    files (even the ones with the Hidden, System, and Read-Only
VF>    attributes assigned) in and below, your current directory:
VF>      deltree /y .

BB> I won't try this right now, but don't you need to change to a higher
BB> level before you can use deltree?  Then you are in another "."
BB> directory?

    I see I'm still not getting all my mail.  Just happened to see the
    above buried within a message from Brice Vineyard to you.

    Anyway, whatever directory you happen to be in is always the "."
    (current) directory.  And, if you're in any directory below the
    root, the directory above is always the ".." (parent) directory.

    For example, take the following portion of a "TREE C:\ /A" output:

      C:\
      +---WINDOWS
          \---SYSTEM

    When in directory C:\WINDOWS\SYSTEM, the "." would represent the
    current directory "C:\WINDOWS\SYSTEM" and the ".." would represent
    the parent directory "C:\WINDOWS".

    When in directory C:\WINDOWS, the "." would represent the current
    directory "C:\WINDOWS" and the ".." would represent the parent
    directory "C:\".

    Now for DELTREE.  Oh BTW, for expermenting with this multiple level
    directory and DELTREE stuff, I'd recommend working from a floppy!

    Let's say you have a bootable hard drive with nothing but the
    following directory structure:

      C:\
      +---1
          \---1

    and are in directory C:\1 (between the root and C:\1\1 directories).
    Issuing the command:

      deltree /y .

    will attempt to delete your current directory and everything under
    it.  Directory C:\1\1 will be gone but, since you're in C:\1, DOS
    can't delete it because the path to your current location ("C:\1")
    would then be invalid.

    Using the structure:

      C:\
      +---1
          \---1
          \---2
          \---3

    and you're in C:\1\2, type:

      deltree /y ..

    and everything below the parent directory, C:\1, will be deleted
    with the exception of the path to your current location.  In other
    words, all that will be left would be:

      C:\
      +---1
          \---2

    While we're on the subject of DELTREE, say you have the following:

      C:\
      +---1
          \---1
          \---2
          \---3

    are in directory C:\1\3 and issue the command:

      deltree /y \

    _everything_ in the root directory of drive C:\ including all
    hidden, system and/or read-on files, and all directories and
    everything they contain will be deleted.  The _only_ thing that will
    be left is the path to your current location so DOS can set you back
    down at the DOS prompt.  (Before attempting this on a hard drive,
    make absolutely sure you have a bootable floppy with SYS.COM! <g>).

    Vernon.Frazee@f71.n135.z1.fidonet.org

 -- SPEED 1.40 #1680:

-!- Olms 2.02.b5 [PRSBN46N]
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)


 Area: Batch Language Programming                     FI 
  Msg#: 358                                          Date: 23 Feb 95  11:13:41
  From: Bob Browar                                   Read: Yes    Replied: No
    To: William Lipp                                 Mark:
  Subj: Re: batch file creating

 -=> On 15 Feb 95  02:16:00, William stunned Bob Browar by saying: <=-

 WL> Hmmm.  So you would like recommendations for an advanced self study
 WL> course in batch programming.  Just reading here in BatPower is
 WL> pretty good,

Yes it is and people are very helpful. It's just that sometimes
I feel I don't know enough to even ask a question.

 WL> but I suppose there are a few "advanced" level ideas that
 WL> get used regularly.  Some additional standard things:

 WL> 1. "@" starting a line
 WL> 2. echo. (with the period)
 WL> 3. Command.COM /C
 WL> 4. CTTY

 WL> Some common tricks:

 WL> 1. Magic named batch files
 WL> Like "Current.bat" with date or time
 WL> Like "--------.bat" with find
 WL> 2. Redirected Prompts as batch files
 WL> Like PROMPT SET DRV=%P
 WL> 3. Get and study the must recent MicroSoft Undocumented Features
 WL> (MUF, compiled by Gary Cooper, a regular here)
 WL> The "/f" flag of Command.com comes up regularly.

Thanks I will be studying these whenever I get a chance.
... Bob B.
-!- Blue Wave/Max v2.12 [NR]
 ! Origin: Compu-Ray! BBS (315)894-0951 Max/2 & OS/2! (1:2609/202)


 Area: Batch Language Programming                     FI 
  Msg#: 427                                          Date: 01 Mar 95  16:00:44
  From: Gerry Pareja                                 Read: Yes    Replied: No
    To: Scott Scheibe                                Mark:
  Subj: Checking attributes

SS> I want to know how to check for the existence of an archive
SS>attribute before preforming an action. I have a batch file that has
SS>pkzip archive it the attribute is set but don't know how to have
SS>the batch file not run the command if it isn't set. "Nothing to do"
SS>messages from PKZIP are a bit annoying.

 You could re-direct PKZIP's output to a temp file.

      pkzip -u myzip file2zip >tempfile

 Then check the file for the string "Nothing to do"

 type tempfile|find /i "nothing to do">temp1
 copy temp1 temp2 >nul
 if exist temp2 del tempfile
 for %%x in (1 2) do del temp%%x
 if exist tempfile type tempfile

 if it's there, delete the temp file, if not, TYPE the file which should
 contain the details of changes made.

 Or, even simpler, re-direct PKZIP's output to NUL.

     pkzip -u myzip file2zip > nul

 This avoids all messages (good or bad).  If you test for errorlevels,
 12 (should) mean that there was "nothing to do" while 0 means that an
 update was performed.

 if errorlevel 12 if not errorlevel 13 echo Nothing to do.
 if errorlevel 0 if not errorlevel 1 echo Updated.


 Gerry


 * OLX 2.1 TD * G. Pareja * Vancouver * B.C. * Canada *

-!- Maximus 2.02
 ! Origin: VKUG/VPCC Batpower Echo - Richmond, BC (1:153/151)


 Area: BATPOWER 
  Msg#: 1                                            Date: 13 Mar 95  14:41:46
  From: Bat Lang
    To: Joel Caturia
  Subj: Re: Bfds Stuff For Ftp?

 -=> Quoting Joel Caturia to Bat Lang, {09 Mar 95  09:29:05} <=-

 JC> No disrespect mean at all...
 JC> But are you the moderator? I don't know who is...

Technically no.  Defacto, yes.  Please see my response To: David
Cracraft, Subj: Don Hoffman ???, this same pkt that contained your
query.  Good Modeming!  /\oo/\

... Fido NetMail: 1:382/1201, or Internet: bat@infomail.com


 Area: Batch Language Programming                     FI 
  Msg#: 444                                          Date: 15 Mar 95  11:51:18
  From: STEVE REID                                   Read: Yes    Replied: No
    To: JOEL CATURIA                                 Mark:
  Subj: Help With Pausing/Time De

MB> CHOICE /C:12 /T:1,30

JC>BUT!
JC>That will abort if someone hits a key, right?
JC>Or could you make it not accepts ANY keystrokes?

Try this:

REM|CHOICE /C:12 /T:1,30>NUL

That will prevent it from accepting input or producing output. 30 second
delay, unless the user hits CTRL-C.

                           Steve Reid - Supreme Overlord of the Universe


Fido: STEVE REID (1:153/414)
Internet: sreid@sea-to-sky-freenet.bc.ca

-!-
  SLMR 2.1a 

-!- GOMail v2.0t Beta [94-0405]
 ! Origin: Bandylan BBS, Squamish, BC (1:153/414)


 Area: Batch Language Programming                     FI 
  Msg#: 438             Rec'd                        Date: 16 Mar 95  23:42:00
  From: Bob Stettina                                 Read: Yes    Replied: No
    To: Bat Lang                                     Mark:
  Subj: Re: Fdform18.Zip

 BL> At least a year ago, someone in here brought to our attention a
 BL> freeware FD formatter from GE.  It's called FD Format, and I
 BL> have been using it as my primary formatter for FD's ever since.

Hi, Bat!  That might, just possibly, have been me.

 BL> It has a number of options not allowed in the DOS format, but
 BL> is also completely compatible with the DOS util, in that all
 BL> switches of the latter are respected in the former.  But there
 BL> is still more.  Any disk formatted with this pgm, will become
 BL> 'transparent' to the boot routine; ie, if you leave one of your
 BL> FD's in the A: drive when you reboot your system, it will read
 BL> a small msg from the disk and type it to the screen words to
 BL> the effect that the disk was formatted with FDFormat 1.8 and
 BL> does not contain System files, so the boot is continuing.  If
 BL> it did contain the System files, it would respond just like any
 BL> other System disk in the A: drive during a boot.

What actually happens, is that the boot sector contains a program, and
the standard (eg. MS-DOS) boot sector program displays on the screen and
then stops, whereas the FDFORMAT bootsector program displays on the
screen and then returns to the caller (eg.  the boot process continues
to the next in line...).  My personal opinion is that the MS-DOS method
is brain-damaged.  <grin>

 BL> I had a discussion with several other folks about 'sliding
 BL> sectors' (a technique used by this pgm to increase access speed
 BL> of disks so formatted), but none of us could document any
 BL> improvement (nor any degradation or badnesses).

The slewed sector implementation provides a trivial (but non-zero)
performance increase; I've found X:2 and Y:3 seems to work best for me.

However, the 2:1 interleave that is used by FDFORMAT to achieve the
1.7MB capacity imposes a ~20% loss in thruput.  IMHO, this is acceptable
in view of the gain in usable space.  Everything's a compromise.  <sigh>

 BL> Recently I have been experimenting with this pgms higher density
 BL> formatting.  I manage a FD Library of software on 1.44 HD 3.5"
 BL> disks for our PCUG.  In an effort to gain an additional 20%
 BL> capacity on these disks, I am now reformatting them to 1.72mb.
 BL> I started using this technique about 3 months ago, and so far,
 BL> have not had the first hiccup. In order for the system to
 BL> properly respond to these disks, a small util (comes with
 BL> FDFORM18) called FDREAD is required to be in memory.  It only
 BL> takes <200 bytes, but automatically seeks HMA, and if avail,
 BL> loads itself in there, thus uses space not normally used
 BL> anyway.  It is also very well behaved.  I load it early in my
 BL> AEBat, and never know it's there (except for the flawless
 BL> recognition of my 1.72mb 3.5" FD's).

Been doing the same for about 3 years; however...

  1.  about 1 diskette in 20 later fails to read reliably, and

  2.  some drives simply don't reciprocate (possibly due to an
      alignment problem, or a head-crud problem....), and

  3.  I "push" it by one track (to 1.749MB).


 BL> My (over one year) experience with this util has ALL been
 BL> positive.  Be aware that if you intend to use any of these
 BL> higher density formatted disks on another system, be sure to
 BL> take along a cy of FDREAD, which must first be read into memory.

Just make sure that it's on a "standard" density diskette.  <grin>

For those who have a devious bent, there is another use <grin>.

FDFORMATted diskettes *CANNOT* be read by an unaugmented system; hence,
it renders the data unavailable.  That, along with the DELete and
UNERASE make for an interesting combination.  Technically secure.
<grin>

OBTW, here's two other "tricks":

   1.  Use the "standard" 1.44 setting, but override the tracks to 82;
       this gives 1.55MB, and remains bootable, and is readable on darn
       near everything...

   2.  specify a smaller-than-standard # of directories (eg. 64 or 40);
       this also gives a few more bytes of storage...

___ Via Silver Xpress V3.00

-!- Maximus 2.02
 ! Origin: Far Point Station (1:382/77)


 Area: Batch Language Programming                     FI 
  Msg#: 431                                          Date: 16 Mar 95  23:07:54
  From: J.r. Brimmer Iii                             Read: Yes    Replied: No
    To: Roger Scudder                                Mark:
  Subj: Attributes

RS=>   Does anyone know the corresponding decimal values for DOS
RS=>  file attributes?

RS=>     A = ?
RS=>     R = ?
RS=>     H = ?
RS=>     S = ?
RS=>     D = ?

             DEC   HEX
Try       A = 32   20
          R =  1    1
          H =  2    2
          S =  4    4
          D = 16   10

 * SLMR 2.1a * An optimist is a guy without much experience...

-!- GEcho 1.11+
 ! Origin: Eye Resources Network * Des Plaines,IL 708/299-1296 (1:115/299)


 Area: Batch Language Programming                     FI 
  Msg#: 444                                          Date: 17 Mar 95  20:19:04
  From: Greg Miskelly                                Read: Yes    Replied: No
    To: George Jenner                                Mark:
  Subj: Ram disks

 -=> Quoting George Jenner to Larry Nelson <=-

Hi George

 GJ>LN> there is on the brink of nonexistence. I am thinking of a
 GJ>LN> possible prompt change just for RmDsk work. Something like
 GJ>LN> RAM DISK HAS A VERY SHORT MEMORY BOOT AT YOUR OWN PERIL!.
 GJ>LN> Think it will help?

 GJ> Maybe you're missing an opportunity.  What about a TSR that
 GJ> dumps your ramdisk to a real disk every ten minutes, so you
 GJ> only lose the really crucial stuff?  I'm new to this echo
 GJ> because I don't know anything, so I'll twist that frippery
 GJ> into a .bat question: is it possible?

Yes it is possible. However, it is questionable as to why you would
want to do this. The purpose of holding files in a RAM Drive is so
that execution is expedited. The fact that time is taken to copy
output from the RAM drive back to the hard disk really does away
with the need for a RAM Drive in the first place. I suggest that
you keep your bats, and/or temp files in the RAM drive, but
organise your data to be saved to disk in the first place rather
than a kludge to check for attributed data files in the RAM Drive.

 GJ> q1: how do you interrogate time and date in .bat?

Redirect screen output to a batch file that is then called from
the controlling bat.
- - - - - - - - - - - - - - - < cut > - - - - - - - - - - - - - - -
@echo off
   rem T&D.BAT Time and Date

   rem put date in env var DATE$ & day in DAY$
      ver|date|find "is">%temp%\temp.bat
      echo set date$=%%4>current.bat
      echo set day$=%%3>>current.bat
      call %temp%\temp
      echo Today's Date is %date$%
      echo         Day is %day$%
      set date$=
      set day$=
      del current.bat

   rem put time in env var TIME$
      ver|time|find "is">%temp%\temp.bat
      echo set time$=%%3>current.bat
      call %temp%\temp
      echo         Time is %time$%
      set time=
      del current.bat
      del %temp%\temp.bat
- - - - - - - - - - - - - - - < cut > - - - - - - - - - - - - - - -

 GJ> q2: can a bat become a tsr that keeps watching, ie doesn't
 GJ> terminate? That seems contradictary, but certain Norton (for
 GJ> example) utitilities seem to watch over me all the time.

Batch Files do not load into memory as such (Norton's NDOS .BTM
files load in the same way as executables). They read one line
in at a time and perform that instruction.

Regards
Greg
___ Blue Wave/QWK v2.12

-!- Maximus/2 2.01wb
 ! Origin: The MonuSci BBS (2:255/100)


 Area: Batch Language Programming                     FI 
  Msg#: 419                                          Date: 18 Mar 95  12:23:28
  From: STEVE REID                                   Read: Yes    Replied: No
    To: JAMIE HERMANS                                Mark:
  Subj: Tips and Tricks

Most/all of your messages were cut off after 149 lines. When posting
large messages, make sure that *all* of the parts are less than 150
lines, or you'll lose some.

Here's another item you might like to add to your collection...

::1IN5.BAT by Steve Reid
@echo off
echo x>>c:\count
find /c "x" c:\count>%temp%\temp.bat
echo set count=%%2>%temp%\--------.bat
set oldpath=%path%
path %temp%
call %temp%\temp.bat
path %oldpath%
set oldpath=
del %temp%\temp.bat
del %temp%\--------.bat
if not %count%==5 goto end
del c:\count
::Once in Five commands go here
c:\dos\defrag c: /f/sn
:end
set count=

The above will defrag your C: drive every 5th time it is run. You could
CALL it from AUTOEXEC.BAT and defrag on every 5th bootup. And it could
be easily altered for other purposes. Mostly, tho, it's to show how a
count file and FIND/C can be used to increment an environment variable.

Each time the above is run, a line with an X is added to the C:\COUNT
file. FIND/C is then used to count the number of lines with an X, thus
counting the number of times the batch file has been run. The
magic-named --------.BAT is used to place the output of FIND into the
COUNT evar.

                           Steve Reid - Supreme Overlord of the Universe


Fido: STEVE REID (1:153/414)
Internet: sreid@sea-to-sky-freenet.bc.ca

-!-
  SLMR 2.1a 

-!- GOMail v2.0t Beta [94-0405]
 ! Origin: Bandylan BBS, Squamish, BC (1:153/414)


 Area: Batch Language Programming                     FI 
  Msg#: 413             Rec'd                        Date: 19 Mar 95  08:39:58
  From: Gerry Pareja                                 Read: Yes    Replied: Yes
    To: Bat Lang                                     Mark:
  Subj: pkzip multi-disk backup

BL> GP> I agree. ARJ does a better job of multi-volume archives. Each one is
BL> GP> individually accessible (I could extract file MYFILE.TXT even if it
BL> GP> were somewhere in the middle of the third ARJ-created archive).

BL>And can you readily determine which disk it is on?  How?

 Yes, there's a command-line switch to do it.  I can't remember it off
 the top of my head (isn't that what BAT files are for??).  The other
 thing you can do is to have ARJ log the names of all files into a text
 file, and use LIST or w-h-y to check which archive the file is in.
 Here's what a short segment of an ARJ multi-vol log file, shown just
 around where the break happens between volumes:

 C:\TELIX\SCRIPTS\#NEWHOST.BAT
 C:\TELIX\SCRIPTS\#SALT.ZIP
 Testing F:\BACKUP\ALLBU.ARJ
 Next volume - 001 1      12904 C:\TELIX\SCRIPTS\#SALT.ZIP
 1994-11-05 11:50:02      12904 F:\BACKUP\ALLBU.A01
 C:\TELIX\SCRIPTS\#SALT.ZIP
 C:\TELIX\SCRIPTS\DIRNAME

 so, by looking with LIST, I can see where the break is, and so where to
 look for the actual file.  The above tells me that the first 12,904
 bytes of #SALT.ZIP are in one volume, the rest in the following volume.
 Extracting a file that spans two volumes is possible, but trickier;
 it's well documented, though.

 We're seriously straying off topic, though.

BL> GP> You can then XCOPY and COMP the copies so you have greater assurance

BL>Now if you could only XCOPY it to tape.  {^; To experience tape backups
BL>is to NOT want to go back to disks (even 1.72mb disks).  {^;  Good

 Yeah, I borrowed the Trakker unit from the office the other day, so I
 know what you mean.  However, it is slow, and unbelievably noisy
 (whines).

 Gerry


 * OLX 2.1 TD * G. Pareja * Vancouver * B.C. * Canada *

-!- Maximus 2.02
 ! Origin: VKUG/VPCC Batpower Echo - Richmond, BC (1:153/151)


 Area: Batch Language Programming                     FI 
  Msg#: 439             Local                        Date: 22 Mar 95  01:19:57
  From: Bat Lang                                     Read: Yes    Replied: No
    To: Mark Livingston                              Mark:
  Subj: Bat again! (1)

 -=> Quoting Mark Livingston to Mike Nisbett, {20 Mar 95  02:17:00} <=-

 MN> No it's not! Please send again.

 ML> Sorry it took so long to come back to this. The splitter on the RBBS
 ML> where I normally post mangled the message during the split.

 ML> Here it is again:

 ML> -------------------------->CUT HERE<-----------------------------
 ML> NBAT2EXEC.ZIP

Mark, this file is avail thru the BFDS, and is *not* a candidate for
posting in here.  Please do not post files from the BFDS or other
readily available files.  This echo is not meant to duplicate the work
of the FDN's.  Sysops ought not to be paying to transport these things
thru here, having already paid to make them available via other means.

It is enough to point out a source for them.  If you do not know what is
readily available, then you should not be scripting in here.
Thanks for your future cooperation, and Good Modeming!  /\oo/\

... Fido NetMail: 1:382/1201, or Internet: bat@infomail.com
-!- Blue Wave/Max v2.12
 ! Origin: The HUB * Austin TX * Centex PCUG * 512-346-1852 (1:382/1201)


 Area: Batch Language Programming                     FI 
  Msg#: 430                                          Date: 21 Mar 95  08:52:35
  From: STEVE REID                                   Read: Yes    Replied: No
    To: LARRY NELSON                                 Mark:
  Subj: rem |choice

LN>   The rem| you used has still got me stumped. I made it work allright but
LN>am lost as to why it's there. I droped it off and swaped your 12, 1 choices
LN>and default for alt/255, and /n this allows LOK2 to run without a selection
LN>being repeted on the screen, I assume that's what the >nul part was for.

CHOICE cancels it's delay if the user presses a key. So, the REM| is to
prevent CHOICE from accepting any input. The first thing I tried was

CHOICE/C:12/T:1,5<NUL>NUL

but that didn't work, since using NUL as an input device results in
endless EOF characters, which CHOICE reads as CTRL-Z keypresses, thus
cancelling the delay every time. OTOH, REM| will send a zero-byte file
into CHOICE. No EOF or anything, just nothing. And since the input is
being redirected, CHOICE is no longer watching the keyboard.

I suppose using /c:[alt255] and the /n parameter would be better than
redirecting the output to NUL, although it does produce an extra blank
line.

Here's a slightly better way than REM|...

CHOICE/C:1/T:1,5<CLOCK$>NUL

Uses redirection instead of a pipe. No temp files that way.

CLOCK$ is another reserved filename, a device. If you read from it you
get nothing, which is what we want. If you write to CLOCK$, you'll screw
up the time/date and have to go into the CMOS setup to fix it, so be
careful. For our puroses, an inactive COM or LPT port would also work,
as long as there's no data coming in from that device. But with CLOCK$,
there's no data coming from it, so it's the best choice.

<shells to dos>
Strange... I just tried TYPE CLOCK$, and for a while there was nothing,
then a bunch of ASCII 180, then nothing, then more ASCII 180... For some
reason, CHOICE doesn't notice this, as CHOICE<CLOCK$ works just fine no
matter how long it sits there. Can anyone explain this? Vernon?

                           Steve Reid - Supreme Overlord of the Universe


Fido: STEVE REID (1:153/414)
Internet: sreid@sea-to-sky-freenet.bc.ca

-!-
  SLMR 2.1a 

-!- GOMail v2.0t Beta [94-0405]
 ! Origin: Bandylan BBS, Squamish, BC (1:153/414)


 Area: Batch Language Programming                     FI 
  Msg#: 431                                          Date: 20 Mar 95  18:55:53
  From: Darcy Gehl                                   Read: Yes    Replied: No
    To: Les Campbell                                 Mark:
  Subj: Question

Is there a way to turn off the sending of xprecit.dat the reception
verification package for Sxpress.  I find that it only serves a use if you keep
your reply packages after you send them.  I delete them right after they are
successfully copied to the system.  I just find them annoying and they only
take up room.

TTYL::Darcy Gehl


-!- InterEcho 1.04
 ! Origin: REDEYE BBS, Edmonton Alberta, Canada (1:342/19)


 Area: Batch Language Programming                     FI 
  Msg#: 432                                          Date: 20 Mar 95  21:46:43
  From: Philippe Lam                                 Read: Yes    Replied: No
    To: Les Campbell                                 Mark:
  Subj: Question

Hi Les, I really like the changes in the BBS, I like Wildcat! more than any
other BBS package. Well this time I logged in with my real name and all the
info is true! Take care! -Philippe Lam


-!- InterEcho 1.04
 ! Origin: REDEYE BBS, Edmonton Alberta, Canada (1:342/19)


 Area: Batch Language Programming                     FI 
  Msg#: 398                                          Date: 20 Mar 95  21:57:04
  From: Joe Pike                                     Read: Yes    Replied: No
    To: Greg Miskelly                                Mark:
  Subj: A Way With Words!

      -=> Quoting Greg Miskelly to Andrew Baldino on 03-17-95  16:09<=-

 GM> The whole point about becoming proficient in the creation of
 GM> batch files is the increased automation of the procedures that
 GM> are in operation on the computer concerned. Batch files do not
 GM> have any memory overhead, and can be used to collect data that
 GM> is produced by compiled programs, then either pass that data on
 GM> to the next compiled program, or branch to an alternative
 GM> process.

 Yew duu have a way wid words, Greg! This is one of the most cogent
 and succinct definitions I've ever seen of batch-file "programming."
 Thanks for sharing it (really!).
                                             Joe Pike

... Dynamic linking error.  Your mistake is now in every file.
___ Blue Wave/QWK v2.12

-!- Maximus/2 2.01wb
 ! Origin: System Control (817)268-6637 Hurst, TX (1:130/1007)


 Area: Batch Language Programming                     FI 
  Msg#: 448                                          Date: 23 Mar 95  20:37:00
  From: Benjamin Ng                                  Read: Yes    Replied: No
    To: Mike Penta                                   Mark:
  Subj: Shift TSR

Greetings Mike!

03-21-95 (10:35), Mike Penta wrote to All about Shift TSR:

 MP> I'm writing a batch file that loads TSR's only when I need
 MP> them. I saw a short COM program in this echo that would produce
 MP> an error level if the SHIFT key was down, does anyone still
 MP> have this?

I imagine you're sticking this into your AUTOEXEC.BAT during bootup
to check whether or not to load certain TSRs.  I'm not sure if this
is what you're looking for, but here's a quick one I whipped up
(22 bytes):

 n shfterr1.com
 e 100 b8 40 0 8e d8 a0 17 0 24 3 88 c4 24 1 d0 ec 8 e0 b4 4c cd 21
 rcx
 16
 w
 q

The above DEBUG script will return an errorlevel of 0 for no shift
pressed, or 1 if either/both shift(s) are pressed.

A smaller (14 byte) version is actually more versatile if you're
interested in WHICH shift (left/right) was pressed.  This way you
can have up to four different configurations for loading your TSRs
simply by checking which shift(s) were pressed.

 n shfterr2.com
 e 100 b8 40 0 8e d8 a0 17 0 24 3 b4 4c cd 21
 rcx
 e
 w
 q

When you run this program, it will return the following errorlevel:

 0 = neither shift key pressed
 1 = right shift key pressed
 2 = left shift key pressed
 3 = left and right shift keys pressed

Hope that helps!

Regards,
Ben.

-!- Maximus 2.02
 ! Origin: TechTalk; Calgary, Alberta, Canada. USR V.Everything (1:134/40)


 Area: Batch Language Programming                     FI 
  Msg#: 441                                          Date: 23 Mar 95  18:23:15
  From: STEVE REID                                   Read: Yes    Replied: No
    To: JAMIE HERMANS                                Mark:
  Subj: TIPs & TRICKs

JH>I think from now on I'll only be posting the latest updates.  With Tips and
JH>Tricks being available via email and now on a Web Page (the whole sh'bang)

Web page? Could you give us the URL?

BTW, here's *another* item you might like to add to the collection. It's
a README.BAT file. Just add the batch code to a text file and rename the
file to a BAT.

@rem README.BAT by Steve Reid
@echo off
set @name=%0
if exist %0.bat set @name=%0.bat
type %@name%|find /v "@"|more
set @name=
goto end@
This batch file will type itself through MORE while filtering
out the commands that do the typing. Both FIND and MORE must
be available for this to work.
:end@

TTYL.
                           Steve Reid - Supreme Overlord of the Universe


Fido: STEVE REID (1:153/414)
Internet: sreid@sea-to-sky-freenet.bc.ca

-!-
  SLMR 2.1a 

-!- GOMail v2.0t Beta [94-0405]
 ! Origin: Bandylan BBS, Squamish, BC (1:153/414)


 Area: Batch Language Programming                     FI 
  Msg#: 429                                          Date: 25 Mar 95  15:06:10
  From: Matthew Lewis                                Read: Yes    Replied: No
    To: Jafir El-kurd                                Mark:
  Subj: Help!!!! me please.

Hello Jafir,

At 16:53, 24 Mar 95, Jafir El-kurd wrote to Dennis Mccunney:

JE> Well the thing is, I have a 560 meg HDD and the bios of my computer are a
JE> little dated.  I tried calling the company, but I could never get through.
JE> I was wondering if there was a program that could temporarilly take the
JE> place of a $10 dollar chip until I can order it? My computer only gives me
JE> 530 megs (not to much lost)

A new BIOS won't help.  At least not with DOS.

DOS can handle a maximum of 16 heads, 1023 cylinders, and 63 sectors per track,
which depending on how you count your megabytes, will give you a maximum of
either 527.9 or 503.5 megs.

To get any more, you need to use special partitioning software, such as Disk
Manager, which is usually included in the box with large drives.  I even got a
copy with a 420 meg Conner drive I bought last October.

You then have to decide whether or not the extra 30 megs of disk space is worth
the memory you'll lose by loading another device driver in Config.Sys, or if
it's enough of an incentive to change operating systems to one that will handle
larger drives.

If you didn't get a copy of Disk Manager with the drive, and want one, you can
contact Ontrack Computer Systems at 1-800-752-1333.  I think it's only about
$10 or so.  Be sure to have the make and model of the drive handy when you
call, as there are several different versions of Disk Manager.

                                Matthew.....

-!-
 ! Origin: Flossie's Saloon & BFDS * Calgary, AB * 1-403-262-5998 * (1:134/32)


 Area: Batch Language Programming                     FI 
  Msg#: 449             Local                        Date: 27 Mar 95  01:39:01
  From: Bat Lang                                     Read: Yes    Replied: No
    To: Mike Penta                                   Mark:
  Subj: COMpressing

 -=> Quoting Mike Penta to All, {26 Mar 95  08:34:22} <=-

 MP> I'm looking for a program to combine all my COM programs into one. I
 MP> seen one in COMPUTE! magazine about 10 years ago and wish I would have
 MP> keep my back issues then. Any help would be great. If possible, let me
 MP> know of a BBS to download it from or FREQ it from, since lately,

Mike, there is a file at the BFDS sites to do just that:

XEQ160.ZIP      15560  03-09-95  XEQ Version 1.60 - COM File Library and
Command
                                 Executor allows COM files to be stored inside
                                 XEQ's code and executed by command

I don't know of a BFDS site in OH, but here's a couple in PA that *may*
have it:

  PA    (717)657-8699     VFC    FB     FB        Star        1:270/101
  PA    (215)331-2590     VFC    FB     FB          A         1:273/40

or you can get it here, just as above:

Avail for 24hr freq-only, from my Origin, 3 lines, all USR DS, V.Ev's.
Good Modeming!  /\oo/\

... Fido NetMail: 1:382/1201, or Internet: bat@infomail.com
-!- Blue Wave/Max v2.12
 ! Origin: The HUB * Austin TX * Centex PCUG * 512-346-1852 (1:382/1201)


 Area: Batch Language Programming                     FI 
  Msg#: 430                                          Date: 26 Mar 95  10:40:32
  From: Gerry Pareja                                 Read: Yes    Replied: No
    To: Dave Cloutier                                Mark:
  Subj: Utility to Delete Lines

DC>I'm looking for an utility to delete lines in a Text file,
DC>I heard of DELTOP but cannot find it anywhere. Anybody own
DC>a such utility?

 Here's a _really_ simple-minded one:

 @echo off
 :: DELTOPLI.BAT - G. PAREJA - NOV/94
 if "%2"=="" goto syntax
 echo %2e|edlin %1 >nul
 goto end

 :syntax
 echo.
 echo SYNTAX:  %0 [yourfile] DDDDDD....
 echo.
 echo where the number of D's indicates how many lines you wish to have
 echo deleted starting from the top of the named file.
 echo.
 echo Example: %0 [yourfile] D           will delete the top line
 echo          %0 [yourfile] DDD         will delete the top 3 lines
 echo          %0 [yourfile] DDDDDDDDDD  will delete the top 10 lines
 echo.
 echo NOTE: EDLIN needs to be in the PATH.
 echo.

 :end


 * OLX 2.1 TD * G. Pareja * Vancouver * B.C. * Canada *

-!- Maximus 2.02
 ! Origin: VKUG/VPCC Batpower Echo - Richmond, BC (1:153/151)


 Area: Batch Language Programming                     FI 
  Msg#: 442                                          Date: 03 Apr 95  01:00:01
  From: Jeff Brielmaier                              Read: Yes    Replied: No
    To: David Cracraft                               Mark:
  Subj: BATCH FILE PROBLEM

DC> > VF>     md\temptemp                               (1)
DC> > VF>     rem>\temptemp\temptemp                    (2)
DC> > VF>     echo Testing for [Y]es/[N]o response.     (3)
DC> > VF>     echo Press [Y] or [N] & then [Enter]:     (4)
DC> > VF>     del \temptemp>nul                         (5)
DC> > VF>     if exist \temptemp\temptemp goto NO       (6)
DC> > VF>    :YES ---------------------------------
DC>
DC> > That's a great 'trick'...  I had to look over the bat
DC> > three times before it dawned on me what was occurring.

DC>I've looked it over, and I still don't understand how it works. Can
DC>you maybe tell me what I'm not seeing?

Line 1  : Create a temporary directory
     2  : Create a temporary file (0 bytes) in the temp directory
     3/4: Display the "Y/N question"
     5  : Issue a 'DEL \TEMPTEMP\*.*' command.  The '>nul' causes the
          "Are you sure" message NOT to be displayed.

          If the user answers "Y", the temp file is deleted.  If the
          answer "N", the temp file will still exist.

     6  : If the temp file still exists, user answered "No". [Not shown;
          Delete the temp file/directory and continue w/ "No" response.]

          If the temp file is gone, user answered "Yes".  [Not shown;
          Delte the temp directory and continue w/ "Yes" response.]

 * KingQWK 1.05 # [PK] * And Man said, "Let there be God" and there was God.

-!- FLAME v1.1
 ! Origin: HAL-PC - The New Generation - (713)963-4100 (1:106/4100)


 Area: Batch Language Programming                     FI 
  Msg#: 437             Rec'd                        Date: 06 Apr 95  20:54:24
  From: Matthew Lewis                                Read: Yes    Replied: No
    To: Bat Lang                                     Mark:
  Subj: Netmail

Hello Bat,

At 03:22, 06 Apr 95, Bat Lang wrote to Matthew Lewis:

BL> Have you not received any Netmails from me, recently??

Actually, I did receive it.  I just haven't replied yet, as I finally received
an answer from MF related to the subject, which wasn't perfectly clear, so I've
asked him for a clarification.

As things stand now, there's nothing anyone can do for about another month,
unless we can contact MM and get the password.

                                Matthew.....

-!-
 ! Origin: Flossie's Saloon * Calgary, Alberta * 1-403-262-5998 * (1:134/32)


 Area: Batch Language Programming                     FI 
  Msg#: 395                                          Date: 13 Apr 95  11:29:03
  From: Vernon Frazee                                Read: Yes    Replied: No
    To: James Hill                                   Mark:
  Subj: BATCH FILE PROBLEM

AR>> Ok. I wanna know how to make a batch file with a "input" like
AR>> statement. with a Y or N answer. If that's possible. Is it?
VF>> @echo off
VF>> :YN.BAT - How to prompt for Yes or No
     [ ... ]
VF>>  del \temptemp>nul
     [ ... ]

DT>> That is _very_ tricky, it took me a while to work through
DT>> what you had actually done....but the challenge, can you do
DT>> it so that the response ("y" or "n") is echoed to the screen
DT>> ???

VF> With a file in the "\temptemp" directory and running under
VF> MS-DOS newer than version 3.30, DOS will respond with:
VF>   All files in directory will be deleted!
VF>   Are you sure (Y/N)?
VF> (Note: MS-DOS v2.00 thru v3.30 return the 2nd line only).
VF> Because this output could be confusing and might even scare
VF> quite a few, the ">nul" suffix (redirection to nul) is used to hide
VF> it.  Since _all_ output is still being redirected to NUL when the
VF> user responds, and removing the ">nul" isn't really an option,
VF> having their response appear on the screen is simply impossible.

JH> Not true Vernon, try this:
JH>   @echo off
JH>   rem>testtemp.tst
JH>   echo Testing for [Y]es/[N]o response.
JH>   echo.
JH>   echo Press [Y] or [N]:
JH>   echo.
JH>   del testtemp.tst /p>nul
JH>   echo.
JH>   if exist testtemp.tst goto no
JH>   :yes
JH>   echo Your response was [Y]es.
JH>   goto done
JH>   :no
JH>   echo Your response was [N]o.
JH>   del testtemp.tst
JH>   :done
JH> This works with DOS 6.x, I don't have any other versions so I don't
JH> know if it works with 5.x, 4.x or 3.x. Sample Screen Output:
JH>   C:\BAT>yn.bat
JH>   Testing for [Y]es/[N]o response.
JH>   Press [Y] or [N]:
JH>   y                     ; as you can see the 'y' I typed did appear.
JH>   Your response was [Y]es.
JH>   C:\BAT>
JH> Also this doesn't need to make any directory to work.  Check it out,
JH> and thank you...this is a modified version of your original file.
JH> Enjoy James.

    Well sure, that'll work.  But, having the

    DT> response ("y" or "n") echoed to the screen ???

    when using the command:

      del \temptemp>nul

    VF> is simply impossible.

    BTW, DOS's CHOICE command, which works with DOS version 4.00 and
    later, offers a much easier solution:

      choice /n "Testing for [Y]es/[N]o response: "
      if errorlevel 1 if not errorlevel 2 echo Your response was [Y]es.
      if errorlevel 2 echo Your response was [N]o.

    Vernon.Frazee@f71.n135.z1.fidonet.org

 -- SPEED 1.40 #1680:

-!-
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)


 Area: Batch Language Programming                     FI 
  Msg#: 450             Local                        Date: 17 Apr 95  00:00:06
  From: Greg Miskelly                                Read: Yes    Replied: No
    To: Mary-Ann Rudesheim                           Mark:
  Subj: System Password

 -=> Quoting Mary-ann Rudesheim to All <=-

Hi Mary-ann

 MR> I would like to beaf up security on my systme which would
 MR> make it impossible for anyone to even use it but me.

The word "impossible" is a bit extreme.

 MR> .... So, what I had in mind was a password batch program
 MR> and use autoexec.bat to call it very early in the program,
 MR> however I need a good password.bat program and I can't
 MR> figure out how to write one. I have the basics for
 MR> writing a batch file but this is more complex. I have a
 MR> 486SX with Dos 6.2. j Can ayone help me out on this one?

The only way to render a machine unusable to anyone else is
by using a key encryption program that is running all the
time. These types of program have several problems, the main
one being what do you do if the hardware fails or the
control program becomes corrupt. I would only advise such a
measure if the contents of your machine are _really_ important.

There are various ways to break into a machine.

1  Since you are running MS DOS 6.2 the first thing to do
   is to press the F5 or F8 keys whenever you get the
   message "Starting MS DOS" on screen during startup.

   In order to protect against this you need to have the
   following line in your CONFIG.SYS file:

      SWITCHES= /F /N

2  By pressing Ctrl+C repeatedly during the running of the
   CONFIG.SYS file you will leave a break mecahnism in the
   keyboard buffer which will activate immediately when
   AUTOEXEC.BAT starts causing a "Terminate Batch Job Y/N"
   message.

   There are a number of solutions to this:

   a  Load a Terminate and Stay Resident (TSR) program in
      your CONFIG.SYS file using the INSTALL command, eg

         INSTALL C:\DOS\NOBREAK.COM

      The problem with this is finding the right program.
      Some will indeed prevent Ctrl+C and Ctrl+Break but
      these can be useful keystrokes to get out of an
      application program that is bahaving badly. Also
      some of them do not protect against Alt+Numeric3.

   b  Use a secure password program in the first line of
      your AUTOEXEC.BAT file, it's execution being preceded
      by the character @, eg,

         @PASSWORD Whatever Syntax

      I prefer this method. In fact I wrote a small program
      called PWORD.COM that provides this facility. It is
      available by downloading the file GMUTILS.ZIP from any
      BFDS site. Shelling out... back again..

      NY (212)594-4425  VFC FB  FB      A      1:278/304
      NY (716)381-8538  VFC FB  FB      A      1:2613/210

      These 2 telephone numbers will provide the file.

   c  Finally, a batch file solution

      Place these two lines as the first lines in your
      AUTOEXEC.BAT file:

      @COMMAND /C C:\BATS\DOPASS
      IF ERRORLEVEL 0 IF NOT ERRORLEVEL 1 AUTOEXEC

      Remember to change \BATS\ above to the directory where
      you keep your batch files.

      Here is a sample DOPASS.BAT

- - - - - - - - - - - - - - - < cut > - - - - - - - - - - - - - - -
@echo off
rem DOPASS.BAT Sample Password BAT using SAMPLE as the password
cls
echo Enter Password
:start
   choice /c:abcdefghijklmnopqrstuvwxyz>nul
   if errorlevel 19 if not errorlevel 20 goto pass1
   goto start
:pass1
   choice /c:abcdefghijklmnopqrstuvwxyz>nul
   if errorlevel 1 if not errorlevel 2 goto pass2
   goto start
:pass2
   choice /c:abcdefghijklmnopqrstuvwxyz>nul
   if errorlevel 13 if not errorlevel 14 goto pass3
   goto start
:pass3
   choice /c:abcdefghijklmnopqrstuvwxyz>nul
   if errorlevel 16 if not errorlevel 17 goto pass4
   goto start
:pass4
   choice /c:abcdefghijklmnopqrstuvwxyz>nul
   if errorlevel 12 if not errorlevel 13 goto pass5
   goto start
:pass5
   choice /c:abcdefghijklmnopqrstuvwxyz>nul
   if errorlevel 5 if not errorlevel 6 goto end
   goto start
:end
- - - - - - - - - - - - - - - < cut > - - - - - - - - - - - - - - -

There are other precautions to take. The above measures can be
easily bypassed by booting from a floppy disk. You therefore
need to go into your SETUP (CMOS configuration) and set the
boot process to only boot from the hard disk. While you are
there, set a "Power On Password". This means that the machine
will not start unless a password is provided.

These precautions can also be broken by taking the lid off the
machine and disconnecting certain cables. The way to prevent
this is to get a drill, locate a suitable corner at the back
where you can create two holes large enough for a padlock to
link the case to the cover of the machine. Be careful not to
drill through any important bits. Also, try and keep the
drill waste out of the machine.

Finally, when you walk away from your machine, you will need
to lock it. You can again use the DOPASS.BAT mentioned above,
only this time call it from LOCK.BAT.

- - - - - - - - - - - - - - - < cut > - - - - - - - - - - - - - - -
@echo off
rem LOCK.BAT Calls DOPASS.BAT
@COMMAND C:\BATS\DOPASS
if errorlevel 0 if not errorlevel 1 lock
- - - - - - - - - - - - - - - < cut > - - - - - - - - - - - - - - -

You can use the same principle when constructing a dos menu, ie,
activate a menu batch which uses CHOICE and test for an
errorlevel of zero on return.

If you are a windows user, ensure that your screen saver is set
to a low time (1 minute) and put a password on it. Someone else
may try a Ctrl+Alt+Detele, but they would still be locked out
whenever DOPASS.BAT activates during the startup process.

Now the really awful bit. You'll invariably find that there are
times when you have to leave the machine when it is doing some
processing, such as a large print run. You will have to leave
the machine with the application program running. Many
application programs provide access to DOS. This can nearly
always be prevented by putting the following lines in the
batch that runs the application:

   set comspec=c:\dos\command.com /c /exit
   cd\appdir
   app
   cd\menu
   set comspec=c:\dos\command.com

There are major meanie applications that won't accept this
though and go looking for COMMAND.COM. A good example of
this would be SuperCalc 5.5 for DOS. What you can then do
is run a set of DOSKEY macros redefining the internal
commands of COMMAND.COM to activate the command EXIT.

Hmmm... I've just read the above. It all seems very extreme but
you, and only you, know the value of your own data.

All of the above are commonly known techniques for breaking
into a machine. Obviously I am not going to list other, less
well known, hacking techniques in a public conference like this,
so, if your data is _very_ important, please netmail me regarding
the matter. Although this message orginated in Texas, my netmail
address is 2:443/17 which is a BBS called Planet Earth in Belfast
N Ireland. I'm using the Hub in Texas because every telephone
number in the country here has just changed thereby causing some
havoc with the mail.

Regards
Greg
___ Blue Wave/QWK v2.12

-!- Maximus/2 2.02
 ! Origin: The HUB * Austin TX * Centex PCUG * 512-346-1852 (1:382/1201)


 Area: Batch Language Programming                     FI 
  Msg#: 450             Local                        Date: 21 Apr 95  01:54:40
  From: Bat Lang                                     Read: Yes    Replied: No
    To: Dennis Mccunney                              Mark:
  Subj: sled

 -=> Quoting Dennis Mccunney to Michel Castonguay, {20 Apr 95  05:18:16} <=-

 MC> WHAT NEW VERSION ?  there is only one version of SLED  released by

 DM> Sorry.  I meant the new copy of SLED cloned by the Alt-P/F4
 DM> operation.  I don't think there ever was more than one version of
 DM> SLED, though there has been some confusion because it is around under
 DM> a couple of different file names.

I have seen it listed two ways:  SLED and SLED11.  When I finally
obtained a cy of SLED11, it turns out to have a slightly improved DOC
file, (and I do mean SLIGHTLY).  As I recall, only the last paragraph
was rewritten, and that occurred in 9/9/88.  Here is the last para from
SLED.DOC in the SLED11 vers (all other files were the same in both):

                            INSTALLATION NOTES


        SLED or SLHED can run either from a floppy disk or from
        your hard disk.  To install, simply copy the appropriate
        .COM file to the disk.

        On hard disks, copy the files to a directory contained in
        the PATH command in your AUTOEXEC.BAT file.  When you run
        SLED or SLHED, it looks for its Text files in your current
        directory, which greatly simplifies its use.

        When specifying a file for the editor to use, you may include
        any DOS drive and path information, as you do with any DOS
        command.

Good Modeming!  /\oo/\

... Fido NetMail: 1:382/1201, or Internet: bat@infomail.com
-!- Blue Wave/Max v2.12
 ! Origin: The HUB * Austin TX * Centex PCUG * 512-346-1852 (1:382/1201)


 Area: Batch Language Programming                     FI 
  Msg#: 427                                          Date: 30 Apr 95  06:27:26
  From: Dennis Mccunney                              Read: Yes    Replied: No
    To: Dan Chak                                     Mark:
  Subj: FOR-IN-DO

 ** From Dan Chak to William Lipp on 19 Apr 95  20:58:18
 ** Re: Re: On time jobs

 -=> Quoting William Lipp to Dan Chak <=-
 DC> Ok, thanks.  I guess I was wrong about Command.Com.  Hmmm. 1 thing
 DC> though:  Can you explain for-in-do to me?   I've seen it in here
 DC> often, but I got the 'Only for distribution w/new PCs' version of the
 DC> DOS manual which is 1 cm thick and has nothing in it.

    I'm not sure you'd get better info out of a thicker DOS manual.  FOR
 IN-DO isn't all that well documented in any DOS manual I've seen.

    FOR-IN-DO is COMMAND.COM's implementation of a programming construct
 called a FOR loop.  Essentially, you hand COMMAND.COM a list of
 conditions and a command to perform.  It loops through the conditions,
 performing the command once for each condition.  The COMMAND.COM syntax
 is

    for %%a in (<list>) [do] <command>

    %%a is a variable which is set to the value of the element in the
 list being evaluated.  You can use any letter -- I used a as an example
 -- but only *one* letter.  You cannot, unfortunately, supply a longer
 and more meaningful name.

    <list> is the set of conditions you are supplying.  It may be a DOS
 wildcard, such as *.*, or a space delimited array of strings.

    [do] is optional.  It can be used for readability, but do is implied
 by for, and may be ommitted.

    <command> is what you want DOS to do in the loop.

    There are a number of uses for for loops.  For instance, if you want
 command "foo" repeated 10 times, this will do it:

    for %%a in (0 1 2 3 4 5 6 7 8 9) do foo

    If you want command "foo" executed on all files in the current
 directory, use this:

    for %%a in (*.*) do foo %%a

    You can also use for loops to handle fancy branching in batch files,
 where a for loop becomes a "computed goto":

    for %%e in (15 12 11 8 5 2 1) do if errorlevel %%e goto error%%e
    goto success

 will test the return code returned by a program against the list you
 supply, and jump to the appropriate label in the batch file
 containing the code to deal with the error.]

    The above fragment assumes you are running a program that will
 return 15, 12, 11, 8, 5, 2, or 1 if there is a problem.  Any other
 return code indicates success.  If the return code was 15, the for loop
 would jump to the label :error15, which would have the statements
 needed to handle that error.

    You can accomplish the same effect with:

    if errorlevel 15 goto error15
    if errorlevel 12 goto error12
    if errorlevel 11 goto error11
    if errorlevel 8  goto error8
    if errorlevel 5  goto error5
    if errorlevel 2  goto error2
    if errorlevel 1  goto error1
    goto success

 but the for loop is far more compact.

    A variation on the above can be used to parse parameters fed to the
 batch file on the command line, as in:

    for %%p in (create add copy move delete) do if "%%p"=="%1" goto %%p
    goto bad_parm

    COMMAND.COM will execute for loops from the command line, or in
 batch files.

    There are some "gotcha's!".  One is that you MUST use *two* percent
 signs in a batch file.  The first one is stripped off when the loop is
 processed, as COMAMND.COM sees it and tries to interpret it as a
 variable.  Having two insures one is still there when the loop is
 processed and the variable will be recognised as a variable.

    Another is that redirection is tricky in for loops.  Pipes and
 redirection may not behave as you expect, since DOS will read the line
 and set up the redirection FIRST, *then* process the for loop.






-!- Blue Wave/Max v2.12 [NR]
 ! Origin: * BlueDog BBS * (212) 594-4425 * NYC FileBone Hub (1:278/304)


 Area: Batch Language Programming                     FI 
  Msg#: 450                                          Date: 04 May 95  01:45:04
  From: Gerry Pareja                                 Read: Yes    Replied: No
    To: Lila Godel                                   Mark:
  Subj: Changing to Dir in Envir

LG>I read a message in this conference on 8/12/94 about putting the current
LG>directory in an environment variable which was as follows:

 [deleted for brevity]

LG>I just recently found a use for this (having batch files load programs
LG>a variable. The only problem is that I can't get DOS to change to the
LG>directory in the batch file.  I have tried different commands dir%DIR%,
LG>I am using DOS 6.2 (not 6.21 or 6.22).  If you know

 You can forget about the environment variable altogether.  One batch file
 (which then creates an auxiliary batch file) is sufficient:

 CALL PUSH.BAT

 here's

 :: PUSH.BAT
 :: Thanks to Bernie Hill for posting this in BatPower 94/11
 @IF "%1"=="X" PROMPT @$N:$_@CD $P
 @IF "%1"=="" %COMSPEC%/C %0 X >%TEMP%\POP.BAT

 Then when you need to "POP" back to the original dir:

 CALL %TEMP%\POP.BAT

 That's all.  If %temp% is on a RAM disk, no need to delete it, though
 you can do it all in one line:

 FOR %%A IN (CALL DEL) DO %%A %TEMP%\POP.BAT

 I just tried it from F:\OLX$WORK directory, and here's what POP.BAT
 looks like:

 @F:
 @CD F:\OLX$WORK


 Gerry


 * OLX 2.1 TD * G. Pareja * Vancouver * B.C. * Canada *

-!- Maximus 2.02
 ! Origin: VKUG/VPCC Batpower Echo - Richmond, BC (1:153/151)


 Area: Batch Language Programming                     FI 
  Msg#: 449                                          Date: 04 May 95  11:07:28
  From: Joe Kron                                     Read: Yes    Replied: No
    To: Lila Godel                                   Mark:
  Subj: .BAT to del 8th line of file

This is a batch file to delete the 8th line of a file:

@echo off
rem EDFILE.BAT to delete the 8th line of a file
echo 8,8d > script
echo e >> script
edlin filename < script
for %%a in (filname.bak script) do del %%a


-!- Maximus 2.02
 ! Origin: The 12th Step BBS (1:141/252)


 Area: Batch Language Programming                     FI 
  Msg#: 403                                          Date: 05 May 95  11:55:05
  From: Vernon Frazee                                Read: Yes    Replied: No
    To: David Harms                                  Mark:
  Subj: ALIASES

DH> I've also found another simple batch file handy.  It eases typing of
DH> long directory path names when changing drive and path.  I call mine
DH> CDD.BAT:
DH>   @echo off
DH>   rem To allow changing drive and directory with one command
DH>   rem example command   -  CDD D ORIGINS FAMDATA
DH>   rem is the equivalent -  c:
DH>   rem followed by          cd\origins\famdata
DH>   rem and puts you in      c:\origins\famdata
DH>   %1:
DH>   if (%2)==() goto END
DH>   cd \%2 > nul
DH>   if (%3)==() goto END
DH>   cd %3 > nul
DH>   if (%4)==() goto END
DH>   cd %4 > nul
DH>   :END
DH> This allows me to change drives and directories without typing the
DH> backslash.  You could add additional levels with %5, %6, etc. if
DH> your directory structure requires it -- but I would find the SUBST
DH> approach easier for such long paths.

    Here's a much simplier approach:

      @echo off
      :2.BAT
       for %%x in (%1: shift) do if exist %1:\nul %%x
       for %%x in (\ %1 %2 %3 %4 %5 %6 %7 %8 %9) do cd %%x
      :End

    For example:

      2 c windows system

    Would put you in C:\WINDOWS\SYSTEM from wherever you happened to be
    (i.e., A:, B:, C:\DOWNLOAD, D:\NEWSTUFF, ... wherever).  A simple:

      2

    would put you in the root directory of your current drive C:  Want
    to goto drive D: (without having to press a [Shift]-[;])?

      2 d

    Need to be in your NEWSTUFF directory on your current drive?

      2 newstuff

    Way cool eh?  <G>

    Vernon.Frazee@f71.n135.z1.fidonet.org

 -- SPEED 1.40 #1680:

-!-
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)


 Area: Batch Language Programming                     FI 
  Msg#: 424                                          Date: 05 May 95  01:36:15
  From: Gerry Pareja                                 Read: Yes    Replied: No
    To: James Lee                                    Mark:
  Subj: Changing to Dir in Envir

 Quoting JAMES LEE | To: LILA GODEL | Subj: Changing to Dir in Envir

JL>LG>how I might get my batch file to change to the directory in the
JL>LG>environment variable please let me know as having it do so would be most

JL>If the enviornmental variable with the path name stored in it is DIR, then
JL>the line:

JL>cd %dir%

JL>should work fine.

 Well, yes and no....  If the hard drive has more than one partition
 (like C:, D:, E:) the above will only work if the currently logged
 drive is the same as in the %dir% variable.

 In other words, you have to make sure that you log onto the drive
 first:

 c:
 cd %dir%

 (if %dir% is on C:)

 However, a quirk of command.com will simplify matters.  You can append
 a backslash to %dir% and it will log onto the drive:

 %dir%\
 cd %dir%

 Try it.

 Gerry


 * OLX 2.1 TD * G. Pareja * Vancouver * B.C. * Canada *

-!- Maximus 2.02
 ! Origin: VKUG/VPCC Batpower Echo - Richmond, BC (1:153/151)


 Area: Batch Language Programming                     FI 
  Msg#: 402                                          Date: 05 May 95  11:55:04
  From: Vernon Frazee                                Read: Yes    Replied: No
    To: Dimitri Van De Ville                         Mark:
  Subj: JOIN DRIVES ?!

DV> Hello Everybody, As most of you, I'm using MS-DOS 6.2 (with 4DOS),
DV> but I want to JOIN a drive to a directory (as in the bad'ol'5.x
DV> ;))... This command isn't available anymore. I can't do it with
DV> SUBST. Does anyone know a solution or a program which does the same
DV> ?

    JOIN is but one of the several handy utilities included on
    Microsoft's "Supplemental Disk".  It, as well as the upgrade from
    any version of 6.nn to 6.22, is available free from Microsoft's
    Download Service at (206) 936-6735.

      STEPUP.EXE   2552585 6-22-94  7:20p - Upgrade from 6.nn to 6.22
-->   SUP622 .EXE   781125 6-29-94 11:12a - v6.22 Supplemental Disk
      NEW4_622.TXT    4213 6-22-94  7:20p - "What's New" in v6.22

    Vernon.Frazee@f71.n135.z1.fidonet.org

 -- SPEED 1.40 #1680:

-!-
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)


 Area: Batch Language Programming                     FI 
  Msg#: 409                                          Date: 05 May 95  18:46:00
  From: James Lee                                    Read: Yes    Replied: No
    To: Vernon Frazee                                Mark:
  Subj: Mod2zip.Bat

 <** On 05-05-95, Vernon Frazee said to Gary Smith: **>
VF>      @echo off
VF>      :ZIP_MOD.BAT - ZIPs up (using the same filename) and then
VF>      :              deletes all *.MOD files in current directory.
VF>       if exist *.MOD goto Loop
VF>       echo No "*.MOD" files found
VF>       goto END
VF>      :Loop
VF>       if not exist *.MOD goto Done
VF>       for %%x in (*.MOD) do mode %%x>temptemp.bat
VF>       echo pkzip -ex -m %%3 %%3.MOD>invalid.bat
VF>       call temptemp
VF>       goto Loop
VF>      :Done
VF>       for %%x in (temptemp invalid) do del %%x.bat
VF>      :End
VF>
VF>    Pretty slick eh?  <g>
VF>
VF>    Vernon.Frazee@f71.n135.z1.fidonet.org
VF>

woah...the use of mode to remove the extension is ingenious!

And then using Invalid.bat to call it...

::gets on knees to worship Vernon::

 James...

___
 X VbReader 2.22 #NR X A newspaper is a collection of half-injustices.

-!- Maximus/2 2.01wb
 ! Origin: Workplace Connection * (317) 742-2680 (1:201/60)


 Area: Batch Language Programming                     FI 
  Msg#: 432                                          Date: 07 May 95  20:38:18
  From: Jason Tedor                                  Read: Yes    Replied: No
    To: Vernon Frazee                                Mark:
  Subj: MOD2ZIP.BAT

05-May-95 11:55, Vernon Frazee wrote to Gary Smith

VF>     This isn't the shortest solution but, I thought you might find it
VF>     interesting.  Note how the MODE command can be used to simplify the
VF>     proceedure.  Also how this approach doesn't require having to create
VF>     and subsequently delete a temporary subdirectory:

VF>       @echo off
VF>       :ZIP_MOD.BAT - ZIPs up (using the same filename) and then
VF>       :              deletes all *.MOD files in current directory.
VF>        if exist *.MOD goto Loop
VF>        echo No "*.MOD" files found
VF>        goto END
VF>       :Loop
VF>        if not exist *.MOD goto Done
VF>        for %%x in (*.MOD) do mode %%x>temptemp.bat
VF>        echo pkzip -ex -m %%3 %%3.MOD>invalid.bat
VF>        call temptemp
VF>        goto Loop
VF>       :Done
VF>        for %%x in (temptemp invalid) do del %%x.bat
VF>       :End

VF>     Pretty slick eh?  <g>

Yes, you are AMAZING! Your inovativness is unbelievable. I reliazed exactly
what it was doing as soon as I read through it but...I could have never have
thought of that!
Where the hell did you think of that one?
Unbelievable.

L8r,
J

___ Terminate 1.51/Pro
 ! Origin: Jason.Tedor@f21011.n355.z1.fidonet.org (1:355/2.1011)


 Area: Batch Language Programming                     FI 
  Msg#: 437                                          Date: 09 May 95  00:21:02
  From: James Lee                                    Read: Yes    Replied: No
    To: Dan Chak                                     Mark:
  Subj: batch to -=>

 <** On 05-08-95, Dan Chak said to Rick Viscusi: **>
DC> RV> a batch file to zip them up, name them the same as their .cdr name,
DC> RV> and del the .cdr after the .zip is verified good. Can ANYONE help
DC> [...]
DC> RV> help me.....................thanks,
DC> RV> rick
DC>
DC>Assuming that you have a directory c:\cdr_zip where you will place the
DC>archives, a directory c:\corel50\cdr where the cdr files are, then this
DC>is the straight DOS solution:

[Batch file deleted for brevity...]

DC>Hope this helps.  Also, make sure that the cdrtemp\ and corel50\cdr\ are
DC>on the same drive or it will be SLOW.  All that can be eliminated though
DC>by using a trick with for in do loops to separate the file name from the
DC>extention, but I don't remember how. (it's always being posted in this
DC>echo tho... if someone can send ME a message showing how I'd appreciate
DC>it)
DC>                                bye 4 now,
DC>                                Dan
DC>

Hey Dan, here's a batch file that will remove the extension from a filename
(specified as replacable parameter %1) and place it in an enviornmental
variable (specified as replacable parameter %2), it uses Vernon's MODE
method to remove extensions:

::REMEXT.BAT
@echo off
if (%2)==() goto end
mode %1>!temp01!.bat
echo set %2=%%3>invalid.bat
call !temp01!.bat
for %%a in (!temp01!.bat invalid.bat) do del %%a
:end


Hope this helps, if you have any questions about its execution feel free to
ask,

 James...

___
 X VbReader 2.22 #NR X A day without sunshine is like a night.

-!- Maximus/2 2.01wb
 ! Origin: Workplace Connection * (317) 742-2680 (1:201/60)


 Area: Batch Language Programming                     FI 
  Msg#: 391                                          Date: 09 May 95  17:47:00
  From: Michael Mitchell                             Read: Yes    Replied: No
    To: Tom Hill                                     Mark:
  Subj: PC Mag ftp site?

TH>Does anybody know where there might be a cache of all the PC Mag utilities?

TH>-Tom
Tom,
     I think you might try http://www.ziff.com/~pcmag if you have access
to the web.
Michael

-!-
 * OLX 2.1 TD * Backup not found: (A)bort (R)etry (P)anic

-!- WILDMAIL!/WC v4.12
 ! Origin: EMERALD ONLINE * (503)343-1308 * 10GB * 11 NODES *  (1:152/22.0)


 Area: Batch Language Programming                     FI 
  Msg#: 441                                          Date: 15 May 95  23:46:00
  From: Gary Smith                                   Read: Yes    Replied: No
    To: Dan Chak                                     Mark:
  Subj: Re: FOR-IN-DO

DC>  DM> for %%e in (15 12 11 8 5 2 1) do if errorlevel %%e goto error%%e
  >  DM> goto success

DC>  DC> This errorlevel usage is ingenious! In long menuing programs, this is
  >  DC> GREAT! With over 10 variables, this saves a LOT of typing!

DC>  DM> Glad you liked it, but note Gary Smith's correction to my original
  >  DM> post.

DC> Oh oh.. I deleted all my old mail packets yesterday while "weeding" out
  > the HD!  What was the correction, exactly?

When using a GOTO in the FOR statement, you need to check the
ERRORLEVEL values in ascending sequence, because the jump will
be made on the basis of the last true condition.  The above
statement should be coded:

for %%e in (1 2 5 8 11 12 15) do if errorlevel %%e goto error%%e
-!-
 * OLX 1.53 * Life's a bitch, but some of the puppies are cute.

-!- WILDMAIL!/WC v4.12
 ! Origin: The Computer Room-Pickerington, Oh  (1:226/110.0)


 Area: Batch Language Programming                     FI 
  Msg#: 448                                          Date: 18 May 95  13:56:47
  From: Rex Conn                                     Read: Yes    Replied: No
    To: Billy Gilbreath                              Mark:
  Subj: Variables on the command

BG> DM> According to Rex, M'Soft DID try to buy 4DOS a while back.  He and
BG>   >  JP didn't like the deal offered and said "no thanks".  Can't blame
'em,
BG>   >  and I'm grateful it never happened.
BG>
BG> Likely, he should have sold.  If Microsoft is interested, it can
BG> build some  of the 4DOS functionality into it's own product and
BG> leave  JP out of a market.

Funny - that's exactly what Microsoft threatened to do if we didn't
sell 4DOS to them.  That was four years ago; you can see what a good
job they've done enhancing COMMAND.COM since then!  :-)

    - Rex

___
 X KWQ/2 1.2i X

-!- Maximus 2.02
 ! Origin: * BlueDog BBS * (212) 594-4425 * NYC FileBone Hub (1:278/304)


 Area: Batch Language Programming                     FI 
  Msg#: 434                                          Date: 22 May 95  19:52:16
  From: Joe Kron                                     Read: Yes    Replied: No
    To: Bill Cameron                                 Mark:
  Subj: DEBUG with batch files

Create a script file line by line that you want to feed DEBUG using redirect
output and append (> and >>) in the batch file and then the last line of the
batch is DEBUG<script.

-!- Maximus 2.02
 ! Origin: The 12th Step BBS (1:141/252)


 Area: Batch Language Programming                     FI 
  Msg#: 450             Local                        Date: 05 Jun 95  00:47:36
  From: Bat Lang                                     Read: Yes    Replied: No
    To: Greg Miskelly                                Mark:
  Subj: Lack of Mail from zone 1

 -=> Quoting Greg Miskelly to Bat Lang, {02 Jun 95  01:16:00} <=-

 GM> Your netmail was sent on 30 Apr 1995 and I received it this morning
 GM> which was the 1st June 1995. I will be replying in due course. It

                [... text deleted for brevity ...]

 GM> Here is the route:

 GM> that needs a kick in the posterior regarding this. I'm not
 GM> knowledgable enough about FidoNet so I'm asking you whether
 GM> it is considered polite for me to netmail the SysOps at the
 GM> gaps above and ask them about the delay.

Since most of the delay appears to be on my side of the pond, let me
pursue it on this end.  I'll let you know via Netmail {^; but it would
be (apparently) advantageous if you had an Email address??  Let's take
this there or Netmail.  Thanks, and I'll let you know what I hear.  Good
Modeming!  /\oo/\

... Fido NetMail: 1:382/1201, or Internet: bat@infomail.com
-!- Blue Wave/Max v2.12
 ! Origin: The HUB * Austin TX * Centex PCUG * 512-346-1852 (1:382/1201)


 Area: Local 
  Msg#: 3911                                         Date: 12-30-94  10:58
  From: Bryce Welch                                  Read: Yes    Replied: No
    To: All                                          Mark:
  Subj: Re: "rem" versus ":"

        Hello, All!!  My favorite tech guru explains below the advantage
        to using the colon ( : ) to rem out lines in batch files such as
        autoexec.bat.  Thought you All might like to know.    ...Bryce




 CZ> I noticed that you used labels as comments in these batch files, is
 CZ> there some advantage to this approach or is it just personal
 CZ> preferance?  Thanks in advance

 VF> I usually use either ":" or "::" instead of "REM" because there is
 VF> a definite speed advantage.

 VF> ... hang on a sec. (off to do a quick test) ...

 VF> I'm back.  Here's what I did:

 VF> 1) Created a BATch file named X.BAT containing 10,002 lines --
 VF> yep, ten thousand and two.  (Had to so I could get back some
 VF> realistic elapsed times -- this P90's a screamer! <g>).  Anyway,
 VF> it goes something like this:

 VF> @echo off
 VF> :aardvark
 VF> :aback
 VF> :abacus
 VF> :abaft
 VF> :abandon
 VF> [ ... ]  (9,990 lines of more of the same. (Dictionary words)).
 VF> :dissociates
 VF> :dissociating
 VF> :dissolution
 VF> :dissolve
 VF> :dissolved
 VF> echo Done!<beep_char>
 VF>
 VF> 2) Copied X.BAT to Z.BAT and then overwrote the first four
 VF> characters of all lines but two, with "rem ", like so:

 VF> @echo off
 VF> rem dvark
 VF> rem ck
 VF> rem cus
 VF> rem ft
 VF> rem ndon
 VF> [ ... ]  (9,990 lines of more of the same)
 VF> rem sociates
 VF> rem sociating
 VF> rem solution
 VF> rem solve
 VF> rem solved
 VF> echo Done!<beep_char>

 VF> 3) Loaded a timing program (CLK.EXE
 VF> then separately ran Z.BAT and X.BAT three times each (just to
 VF> make sure I got the fastest elapsed time for both).  Results:

 VF> Z.BAT (10,000 lines beginning with REM):  9.35 seconds
 VF> X.BAT (10,000 lines beginning with ":"):   .23 seconds (1/4
 VF> sec!)
 VF> As you can see, X.BAT was over 40 times faster!  Why?  Because DOS
 VF> simply insists on reading all lines that don't begin with a ":".

 VF> Happy Holidays!

 VF> Vernon.Frazee@f71.n135.z1.fidonet.org



... Children come from God.  He can't stand the noise either.
~~~ Blue Wave/Max v2.12

 Area: Batch Language Programming                     FI 
  Msg#: 415                                          Date: 05 Jun 95  12:36:00
  From: Gerry Pareja                                 Read: Yes    Replied: No
    To: Greg Miskelly                                Mark:
  Subj: PSIS.COM Version 5.01

GM>can be distributed via the BFDS. Ver 5.01 will have the

GM>Finally, if anyone feels that they will be using the
GM>program but find that there should be another function,
GM>please let me know as soon as possible. I'm prepared to let

 Great program, Greg.  I'm still mulling over how many of my finely-
 crafted BATs which currently depend on Norton's BE or Stephan's GET.EXE
 I can _improve_ with your little gem.

 A few requests:

 1) a time-out feature on the "PSIS MENU option1 option2 option3..."
 subcommand.  I hate menus that don't time out to something (whether to
 allow the batch to move on to other things, or to engage a screen saver
 if the user is asleep or not at the console).

 While I'm on "Menu", I like your suggestion to convert "_" to spaces
 when the menu is displayed.

 2) display the date & time (I'd prefer "Day YYYY-MM-DD * HH:MM" but
 that could be configurable) as part of the "SAVUNTIL" feature.  The Box
 No. # is cute but not too useful.

 3) On the "Choice" command: can it return the keypress as an env.var.?
 Since I use Norton's BE.EXE which only returns errorlevels, and
 Stephan's GET.EXE which returns both errorlevel and env.var., I find
 that I prefer the env.var. method.  Easier to code and to debug later.
 Example from my EDIT.BAT which runs under LIST:

 echo      E - Edit a file
 echo      K - del *.BAK files
 echo      B - GW-BASIC
 echo      M - MS-DOS prompt
 :: the following means wait for a single character for up to 60 seconds
 :: and put result in env.var. GET
 get c "  -->" /w60
 if "%get%"=="" goto end
 if "%get%"=="E" vde %1
 if "%get%"=="K" del *.bak
 if "%get%"=="B" gwbasic %1
 if "%get%"=="M" prompt [EXIT] to return$_$p$g
 if "%get%"=="M" command.com

 Notice that this does not require "goto" statements (shorter batch
 files--sometimes by a huge margin), and does not require one to check
 if the errorlevel is changed by the action performed.


 Bye for now.

 Gerry


 * OLX 2.1 TD * G. Pareja * Vancouver * B.C. * Canada *

-!- Maximus 2.02
 ! Origin: VKUG/VPCC Batpower Echo - Richmond, BC (1:153/151)


 Area: Batch Language Programming                     FI 
  Msg#: 400                                          Date: 10 Jun 95  02:24:08
  From: Mark Bloss                                   Read: Yes    Replied: No
    To: Peter Freeman                                Mark:
  Subj: Re: .bat to del .bak, .tm

>
>Peter Freeman was probably misquoted, but here goes anyway...
>
 PF> @MSGID: 3:632/309.0 2fd23b0c
 PF> @PATH: 632/309 998 635/503 632/348 711/409 413 808 712/515 105/42 103
 PF> 270/101 -=> Quoting Kramer to All <=-

 Kr> I need to write a batch file that will search an entire drive (c:\),
 Kr> and all dirs and sub dirs, and delete all files with certain extension,
 Kr> such as .bak, .tmp, etc?

 PF> If you find as pure BATCH solution please let me know. I have tried
 PF> using the /B and /S options to DIR without success.
 PF> Currently I use FF.COM which is intended as a FileFinder, but also has
 PF> a number of clever options, one of which is global deletions by
 PF> filespec - with or without confirmation for each file.
 PF> It is generally found as FF or FFF (with one or other archive suffixes
 PF> atached)
 PF> Regards,

 PF> Peter Freeman


    By far the easier method is to use your compression (archiver) program
    to do it.  PKWARE's PKZIP command works great.

    {-------here is all there is to it---------}
    C:
    cd\
    PKZIP -mrP delete.zip C:\*.bak C:\*.tmp D:\*.bak D:\*.tmp etc...
    del delete.zip
    {------------------------------------------}




... "Be careful and have a good time" (mother's paradox curse)
-!- GEcho 1.11+
 ! Origin: A SPYER BBS (1:116/180)


 Area: Batch Language Programming                     FI 
  Msg#: 432                                          Date: 10 Jun 95  13:34:04
  From: Peter Lovell                                 Read: Yes    Replied: No
    To: Dennis Mccunney                              Mark:
  Subj: Gosub/Return In C.C

    -=> Overheard Dennis McCunney to Mark Livingston on 4 June '95 <=-
                    Subj: Does this batch work?

 [...]

 DM>ML> I prefer the recursive CALL %0 [parameter_label] method.
 DM>ML> Works real nice for me. ;)

 DM> Works just fine, if you have CALL.  DOS pre-3.3 or so did not.  And
 DM> it's still nicer is GOSUB/RETURN are supported internally, eliminating
 DM> the need to call an external batch file, but NO version of COMMAND.COM
 DM> does that.

 G'day Dennis,

 Forgive my "butting in" here, but GOSUB/RETURN can easily be faked as
 per the following example:

              echo off
           :Start
              set return=Next_1
              goto Gosub_1
           :Next_1
              set return=Next_2
              goto Gosub_2
           :Next_2
              goto End
           :Gosub_1
              set oldpath=%path%
              path c:\newdir1;%path%
              echo "%path%" is the new path
              path %oldpath%
              set oldpath=
              goto %return%
           :Gosub_2
              set oldtemp=%temp%
              set temp=c:\junkdir
              echo "%temp%" is the new temp directory
              set temp=%oldtemp%
              set oldtemp=
              goto %return%
           :End
              set return=

 But there are a few other considerations:

 GOTO causes command.com to re-read the batch file from the
   first line to search for the label, so it would make sense
   to try and put the most frequently called "subroutines" at
   the start of the batch file.  CALL operates within the
   current shell of command.com, so any batch called batch file
   that fiddles with environmental variables needs extra lines
   to reset such fiddling, whereas

 COMMAND /C creates a new shell, within which all
   environmental variable changes are discarded upon exit.
   Which leads to a definite advantage in that the batch file
   that has been "called" using command/c needs only an EXIT
   command on completion rather that a GOTO END_LABEL which
   would necessitate the re-reading to search for the label.

 Using the recursive CALL %0 [parameter_label] method, that
 Mark prefers, streamlines the operation considerably, making
 the resulting batch file resemble more an object oriented
 programming language's procedure calling than basic's
 gosub/return routines.  Combining the advantages of both
 methods, the example above can be re-written as follows:

              echo off
              if (%1)==() goto Start
              goto %1
           :Gosub_1
              path c:\newdir1;%path%
              echo "%path%" is the new path
              exit
           :Gosub_2
              set temp=c:\junkdir
              echo "%temp%" is the new temp directory
              exit
           :Start
              command/c %0 Gosub_1
              command/c %0 Gosub_2

 Fude 4 fought     o
                _ /-_
          .....(_)>(_)   Peter L.

-!- Maximus 2.02
 ! Origin: Diagnostic BBS * Brisbane-Qld-Australia * (3:640/302)


 Area: Batch Language Programming                     FI 
  Msg#: 450                                          Date: 20 Jun 95  19:25:00
  From: Robert Clark                                 Read: Yes    Replied: No
    To: Dan Chak                                     Mark:
  Subj: File handles

DC> What are file handles?

File handles are 16-bit "tags" that the operating system uses to keep
track of file I/O. Each time you open, create, rename, modify or delete
a file, a file handle is assigned to it and DOS references that handle
whenever it needs to perform some operation on the file.

Versions of DOS prior to V2 used file control blocks (FCBs) for file
access. FCBs are 36- or 43-byte tables set up in memory for each opened
file. FCBs were just one of the notions "borrowed" from CP/M. :)

The number of file handles you may have is set in your CONFIG.SYS file
via the FILES= statement. If the FILES= statement is omitted, the
default is 8; maximum is 255. You should reserve enough to "handle" the
maximum number of files you expect to have open at any one time.

Regards,      *  RelayNet: ARCLIGHT (#1392)      * FidoNet: 1:231/285     *
Robert Clark  *  InterNet: rclark@su1.in.net     * This space for rent.   *

 * RM 1.3 01101 * DOS is for those who can't handle UNIX.


-!- WM v3.10/93-1181
 ! Origin: Arc Light BBS/8 lines/30 cds Indpls IN 317/575-8833  (1:231/285)


 Area: Batch Language Programming                     FI 
  Msg#: 428                                          Date: 24 Jun 95  09:02:23
  From: Vernon Frazee                                Read: Yes    Replied: No
    To: Dennis Mccunney                              Mark:
  Subj: INPUT10.LZH 1/1

JM> Does anyone know how to make, or where to get a batch enhancer that
JM> will get a user's input and place it into an environment variable?

DM> Try the following:
DM> ----------------------------->CUT HERE<---------------------------
DM> NINPUT10.LZH
DM> E100 FC "+"ED BE 8B 1 B9 F5 FD "+"DB 8B D6 B4 "?"CD "!riP"8B DE 8B
VF> [ ... ]

    Here's an example of how to do the same with a BATch file:

    @echo off
    :INPUT.BAT puts what is typed next in environment variable INPUT
     set input=
     echo Type in anything and press [Enter]
     fc con nul /lb1 /n|date|find "    1:  ">temptemp.bat
     echo :Loop>>enter.bat
     echo if not (%%input%%)==() set input=%%input%% %%5>>enter.bat
     echo if (%%input%%)==() set input=%%5>>enter.bat
     echo shift>>enter.bat
     echo if not (%%5)==() goto Loop>>enter.bat
     for %%x in (call del) do %%x temptemp.bat
     del enter.bat
     echo The string you just entered
     echo %input%
     echo has been stored in environment variable INPUT
    :End

    Vernon.Frazee@f71.n135.z1.fidonet.org

 -- SPEED 1.40 #1680:

-!-
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)


 Area: Batch Language Programming                     FI 
  Msg#: 425                                          Date: 24 Jun 95  09:02:20
  From: Vernon Frazee                                Read: Yes    Replied: No
    To: Larry Cooke                                  Mark:
  Subj: String to env. variable

JM> Does anyone know how to make, or where to get a batch enhancer that
JM> will get a user's input and place it into an environment variable?
JM> (What I'm looking for is just this one function. Not an everything
JM> do'er like PSIS, or 4dos's INPUT.)

LC> What's wrong with using PSIS or 4DOS?  How about P2E?  I don't
LC> understand why you don't want to use a multi-function program when
LC> it will do what you need.
LC> To answer your question, I'm not aware of any program that fits your
LC> particular request.

    Here's an example of how to do it with a BATch file:

    @echo off
    :INPUT.BAT puts what is typed next in environment variable INPUT
     set input=
     echo Type in anything and press [Enter]
     fc con nul /lb1 /n|date|find "    1:  ">temptemp.bat
     echo :Loop>>enter.bat
     echo if not (%%input%%)==() set input=%%input%% %%5>>enter.bat
     echo if (%%input%%)==() set input=%%5>>enter.bat
     echo shift>>enter.bat
     echo if not (%%5)==() goto Loop>>enter.bat
     for %%x in (call del) do %%x temptemp.bat
     del enter.bat
     echo The string you just entered
     echo %input%
     echo has been stored in environment variable INPUT
    :End

    Vernon.Frazee@f71.n135.z1.fidonet.org

 -- SPEED 1.40 #1680:

-!-
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)


 Area: Batch Language Programming                     FI 
  Msg#: 450             Local                        Date: 26 Jun 95  01:09:25
  From: Bat Lang                                     Read: Yes    Replied: No
    To: Earl Montgomery                              Mark:
  Subj: Blink

 -=> Quoting Earl Montgomery to Jeff Martin, {25 Jun 95  05:44:52} <=-

 On 06-24-95 JEFF MARTIN wrote to EARL MONTGOMERY...

 JM>         Hi Earl.
 JM>
 JM>         Try putting either of the following lines at the end of your
 JM> batch.
 JM>         (change ESC to the escape character ASCII(27), arrow pointing
 JM> left)
 JM>
 JM>
 JM>         echo ESC[0;37;47m
 JM>
 JM>             or
 JM>
 JM>         prompt $e[0;37;47m$p$g
 JM>
 JM>         Check out your DOS manual under ANSI escape sequences for all
 JM>         the cool stuff you can do using ansi codes, including
 JM>         colorizing, cursor positioning, and key re-assignment.

 EM>    Thank you Jeff. And I will check out the DOS manual.
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Earl

Earl, I am sending this back, just as it was received here (without any
additional quoting, to illustrate my point.  The underlined line,
appears to have been added by you just before your "Earl" signature.  As
such, there should be no quote marks preceding that line.  If your OLR
is doing that, it is not configured as per Fido specs.  Ie, the last
generation of text (your entry on your msg) should not have the EM>
preceding it, just as the lines I am writing now, have no quote marks
preceding them.  This may sound like a nit, but it makes the msg harder
to read.  It's as if all you said in that reply was "Earl".  Hope you
can get this 'fixed'.  Thanks, and Good Modeming!  /\oo/\

... Fido NetMail: 1:382/1201, or Internet: bat@infomail.com
-!- Blue Wave/Max v2.12
 ! Origin: The HUB * Austin TX * Centex PCUG * 512-346-1852 (1:382/1201)


 Area: Batch Language Programming                     FI 
  Msg#: 445                                          Date: 21 Jun 95  17:00:41
  From: David Cripps                                 Read: Yes    Replied: No
    To: Matthew Frei                                 Mark:
  Subj: Batch file for time/date

Hello Matthew!

Thursday June 15 1995 19:56, Matthew Frei wrote to All:

Sounds like you want BATDATE.ZIP, which you can freq. from the Tardis BBS
just round the corner from you at 633/260.

I frequented this only last week, and use this excellent program to create a
mail report for the end of every month, and then delete the log files.
Works just great.


Regards David


... .Old programmers never die, they just terminate and stay resident.
-!- GoldED/386 2.50.A0517+ 22OZ1
 ! Origin: Dave's Point, Hobart, Tasmania 61-02-725267/VFC (3:670/218.6)


 Area: Batch Language Programming                     FI 
  Msg#: 435                                          Date: 29 Jun 95  22:49:00
  From: Robert Clark                                 Read: Yes    Replied: No
    To: Kitt Brown                                   Mark:
  Subj: Blink

KB>  DK> Yeah, you could add:
KB>  DK>
KB>  DK> PROMPT $E0m
KB>  DK> PROMPT $P$G

KB> However, when I tried it from the prompt, the first command did
KB> change the prompt, to 0m but not the color, and the second command
KB> gave me back my normal prompt, but still in lite magenta.

The prompt is incomplete as shown, Kitt.

Basically, you need to reset the screen character attributes using $e[0m
and then set them back to your preferred colors. Try a prompt like the
following:

           prompt $e[0;1m$p$g

where

$e[ = ANSI escape code; begin attribute codes
0   = Reset screen colors to non-blinking grey on black
;   = Separates attribute codes
1   = Sets foreground to hi-intensity (hi-intensity grey=white)
m   = Ends attribute codes
$p  = Displays current disk letter and directory
$g  = Displays greater-than sign

A prompt statement like this one insures that your screen colors will be
reset (in this case, white on black) each time you show a DOS prompt.
There is no need to modify your batch files.

For more help on ANSI escapes sequences and PROMPT, refer to your DOS
manual or, for DOS v6.x, type "HELP ANSI.SYS" or "HELP PROMPT" at the
command line.

Regards,      *  RelayNet: ARCLIGHT (#1392)      * FidoNet: 1:231/285     *
Robert Clark  *  InterNet: rclark@su1.in.net     * This space for rent.   *

 * RM 1.3 01101 * Compatible: Blows up a little later than Incompatible.


-!- WM v3.10/93-1181
 ! Origin: Arc Light BBS/8 lines/30 cds Indpls IN 317/575-8833  (1:231/285)


 Area: Batch Language Programming                     FI 
  Msg#: 428                                          Date: 04 Jul 95  15:58:46
  From: Joe Kron                                     Read: Yes    Replied: No
    To: Ryan wallace                                 Mark:
  Subj: Batch File Books

How about this list...

I made a sublist of my book list selected on BATCH FILES. If there are any
that look interesting to you check your local lib. Are there any that you
think should be added to this list?
                                      BATCH FILE BOOKS
12-01-1994 AT 06:38                                                 Page 1

TITLE                                               AUTHOR
   PUBLISHER
------------------------------------------------------------
--------------------------------
ADVANCED BATCH FILE PROGRAMMING 3rd                 GOOKIN D
   WINDCREST
BATCH FILE POWERTOOLS                               TORNSDORF M & TORNSDORF H
   ABACUS
BATCH FILES TO GO: A PROGRAMMER'S LIBRARY           RICHARDSON R
   WINDCREST
BUILDER LITE DEVELOPING DYNAMIC BATCH FILES         RICHARDSON R
   WINDCREST
CONCISE GUIDE TO MS DOS BATCH FILES                 JAMSA K
   MICROSOFT PRESS
DOS 6 SECRETS                                       AINSBURY R D
   I D G BOOKS
DOS 6.0 POWERTOOLS TECHNIQUES TRICKS AND UTILITIES  GOODMAN J M
   BANTAM
DOS BATCH FILE POWER                                JAMSA K
   SAMS
DR. BATCH FILE'S ULTIMATE COLLECTION                RICHARDSON R
   WINDCREST
ENHANCED MS-DOS BATCH FILE PROGRAMMING              GOOKIN D
   WINDCREST
JAMSA'S 1001 DOS & PC TIPS                          JAMSA K
   OSBORNE
KILLER PC UTILITIES                                 KONICKI S
   QUE
MS DOS BATCH FILE PROGRAMMING                       RICHARDSON R
   WINDCREST
MS DOS BATCH FILE UTILITIES                         RICHARDSON R
   WINDCREST
MS DOS BATCH FILES                                  JAMSA K A
   MICROSOFT PRESS
MS DOS EXTENTIONS                                   DUNCAN R
   MICROSOFT PRESS
MS DOS THE ADVANCED COURSE                          LEIN D
   COMPUSOFT
MS DOS UTILITY PROGRAMS UTILITY SOFTWARE            RICHARDSON R
   WINDCREST
MS-DOS TIPS & TRICKS                                TORNSDORF M & TORNSDORF H
   ABACUS
PC DOS 5 TECHNIQUES AND UTILITIES (copied 2 disks)  PROSISE J
        LEWIS, T G                     RESTON PUB CO/PRENTICE HALL


-!- Maximus 2.02
 ! Origin: The 12th Step BBS (1:141/252)


 Area: Batch Language Programming                     FI 
  Msg#: 444                                          Date: 04 Jul 95  06:38:01
  From: Greg Smith                                   Read: Yes    Replied: No
    To: Mike Grimaldi                                Mark:
  Subj: Re: changing zip file dates

 On a dark and stormy night, Mike Grimaldi said to All ...

 MG> I am looking for a way to determine what the oldest file in a zip is
 MG> and to change the zip date to that date:

 MG> Example:   zipped.zip     04-05-95

 MG> contains:     qaz.txt     04-07-94
 MG>               read.me     06-12-93
 MG>               qwerty.exe  02-02-90
 MG>               last.one    12-04-92

Simple:  pkzip -d -o zipped nul

PKZIP does all that for you!


... "They can eat it!"   - Lisa Marie Presley, 1995
-!- Blue Wave/QBBS v2.12 [NR]
 ! Origin:  ACCENT! - Chandler, AZ - (602) 814-7894 (1:114/402)


 Area: Batch Language Programming                     FI 
  Msg#: 450             Local                        Date: 08 Jul 95  22:59:48
  From: Bat Lang                                     Read: Yes    Replied: No
    To: furlan primus                                Mark:
  Subj: Re: Batch File to:

 -=> Quoting furlan primus to Rick Viscusi, {06 Jul 95  19:04:39} <=-

 fp> paladin3.lzh    45124  11-25-91  17:03 more utilities

Furlan, that is an older version.  The current one is 12/93.

PALADIN.ZIP    46K 12-22-93  BATPOWER,A suite of batch power tools,12/93,
                             updated ALTER bat

Avail for 24hr freq-only, from my Origin, 3 lines, all USR DS, V.Ev's.
Good Modeming!  /\oo/\

... Fido NetMail: 1:382/1201, or Internet: bat@infomail.com
-!- Blue Wave/Max v2.12
 ! Origin: The HUB * Austin TX * Centex PCUG * 512-346-1852 (1:382/1201)


 Area: Batch Language Programming                     FI 
  Msg#: 432                                          Date: 08 Jul 95  13:15:44
  From: Matthew Lewis                                Read: Yes    Replied: No
    To: Gene Chao                                    Mark:
  Subj: HMM...

Hello Gene,

At 00:00, 06 Jul 95, Gene Chao wrote to All:

GC>  FOR %%x IN (1 2 3) DO ECHO %%x >>whatever.txt
GC>  FOR %%v IN (whatever) do echo %%v >>whatever.txt

GC>  Can someone please explain to me?

Ah yes.  The "FOR %%f IN (set) DO" loop.

One of the more powerful, but less understood, batch file commands that
Microsoft included in DOS.

This command is very handy for those times you want to execute the same command
multiple times with different parameters.

Here's how it works.  For each member of the "SET" (the part within the
parenthesis) DO will execute your command, optionally passing the name of that
member of the set as a parameter.

Here are a few examples:

If you have a command named BEEP which simply makes the speaker beep, you could
use a command like:

        For %%f in (1 2 3 4 5) do beep

and your speaker would beep 5 times.

In a batch file, this would be slightly faster than using the "BEEP" command on
5 lines.

When the DOS wildcards "*" or "?" are included as part of a member of the set,
it is assumed that these members are filespecs, so the command:

        For %%f in (*.dat *.doc *.txt) do del %%f

would delete all *.dat, *.doc, and *.txt files in the current directory.

Members of the set may be seperated by a space or a semicolon, so a command
like:

        For %%f in (%path%) do whatever %%f

would execute the command "whatever" once for every directory listed in your
PATH environment variable (they're seperated by semicolons already) and pass
the name of that directory to Whatever.

However, any %% variables used MUST come before any piping or redirection, or
the command will fail.  DOS evaluates any piping or redirection before
evaluating the rest of the command line, so the command:

        For %%f in (1 2 3 4 5) do echo Hello >> %%f.txt

would only leave you with a file named %F.TXT in the current directory with the
word "Hello" on its last 5 lines.

                                Matthew.....

-!-
 ! Origin: Flossie's Saloon & BFDS Site * Calgary * 1-403-262-5998 (1:134/32)


 Area: Batch Language Programming                     FI 
  Msg#: 437                                          Date: 07 Jul 95  13:04:00
  From: Clay Cherneff                                Read: Yes    Replied: No
    To: Robert Gilbert                               Mark:
  Subj: How do I

 RG> ...create an "ED" file which has the following entries/why
 RG> doesn't this work?:

 RG> Echo off
 RG> cls

 RG> if "%1" == "a" goto edauto
 RG> if "%1" == "c" goto edconf

 The last two lines are case sensitive - if you enter "ED a", your
 batch _should_ goto edauto, but if "ED A" is entered, %1 will NOT
 equal either a or c...

 Try...for %%x in (a A) do if "%1"=="%%x" goto edauto
 and the same for c...

 Clay

... A feature is a bug with seniority.
-!- Blue Wave/SBBS v2.12 [NR]
 ! Origin: Mystic Runes 28.8 DS V.Everything [604]746-0156 (1:340/207.0)


 Area: Batch Language Programming                     FI 
  Msg#: 434                                          Date: 08 Jul 95  14:00:44
  From: Matthew Lewis                                Read: Yes    Replied: No
    To: Alan Hamon                                   Mark:
  Subj: numlock

Hello Alan,

At 01:49, 06 Jul 95, Alan Hamon wrote to All:

AH> Is it possible to turn on my numlock key in my autoexec.bat? Is so what
AH> do I need?

There are numerous external utilities that can do this from any batch file. One
that I use is Kbset.Exe that will allow you to read and/or set the state of the
NumLock, CapsLock, or Scroll Lock keys.

It's available here as KBSET.ZIP (21K).

However,  Autoexec.Bat is a strange place to use one, as most "AT" class
computers will boot up with the NumLock ON by default (some have it as an
option in the CMOS setup).

With MS-DOS version 6.0 and later, you can include the line:

        NUMLOCK=OFF
or      NUMLOCK=ON

in your Config.Sys file, should you desire other than the default at boot-up.


                                Matthew.....

-!-
 ! Origin: Flossie's Saloon & BFDS Site * Calgary * 1-403-262-5998 (1:134/32)


 Area: Batch Language Programming                     FI 
  Msg#: 436                                          Date: 11 Jul 95  18:17:40
  From: Matthew Lewis                                Read: Yes    Replied: No
    To: Arlo Ihrig                                   Mark:
  Subj: Date env. var?

Hello Arlo,

At 21:02, 09 Jul 95, Arlo Ihrig wrote to ALL:

AI> Does anyone know if there is a way to set an environment variable to the
AI> date?

Pick a number.  Any number.  Double it.  There are probably at least that many
ways to do it.

I will present below, only one of these many ways, that I happen to like.  If
it suits your needs, feel free to use it all you want.  If not, then hopefully,
it will give you some ideas of your own.

It makes use of Rob Flor's P2E.COM, a small (6K) PD utility which is widely
available, and posted as a script in this echo from time to time.

It will set the following environment variables:

        DA=     Day of the week (2 letters, Su, Mo, Tu, etc)
        DAY=    Day of the week (full spelling, Sunday, Monday, etc)
        DM=     Day of the month (2 digits)
        DOM=    Day of the month (leading zero stripped from DM)
        MO=     Month (2 digits, 01-12)
        MON=    Month (first 3 letters, Jan, Feb, Mar, etc)
        MONTH=  Month (full spelling)
        YR=     Year  (last 2 digits )

This leaves you the option to easily format the date any way you wish to in
some later batch file where you need the date information.

There are 2 areas where it gets quite repetitive.  I've noted those areas, and
deleted several lines to keep the message a bit shorter.  I doubt anyone
reading my message will have any difficulty figuring out exactly what's been
deleted.  I've also added a few comments with REMs.

Herewith, my VARS.BAT:

    @echo off
 REM    set the DA variable
    echo. | date | p2e e da /f "Current" /m 17,2 > nul
    goto %da%
    :Su
    set day=Sunday
    goto d
    :Mo
    set day=Monday
    goto d
 REM         [ 12 lines deleted here ]
    :Sa
    set day=Saturday
    :d
 REM    set the DM variable
    echo. | date | p2e e dm /f "Current" /m 24,2 > nul
    set dom=%dm%
 REM       Even after over a year, I'm still rather proud of the next
 REM       line, which strips the leading zero from a 2 digit number.    ;-)
    for %%f in (1 2 3 4 5 6 7 8 9) do if $%dom% == $0%%f set dom=%%f
 REM    set the MO variable
    echo. | date | p2e e mo /f "Current" /m 21,2 > nul
    goto %mo%
    :01
    set mon=Jan
    set month=January
    goto y
    :02
    set mon=Feb
    set month=February
    goto y
 REM         [ 36 more lines deleted here ]
    :12
    set mon=Dec
    set month=December
    :y
 REM    set the YR variable
    echo. | date | p2e e yr /f "Current" /m 29,2 > nul

That's it.  I normally CALL it from my Autoexec.Bat after loading all of my TSR
programs, then all the variables are available for testing before running
periodic housekeeping chores.

Like Rob's P2E.COM (part of his PALADIN.ZIP - 48K) its potential uses are
limited only by your imagination.

If you don't already have it, and can't find it closer to home, just freq
PALADIN from here, any time but ZMH +/- 15 minutes.

                                Matthew.....

-!-
 ! Origin: Flossie's Saloon & BFDS Site * Calgary * 1-403-262-5998 (1:134/32)


 Area: Batch Language Programming                     FI 
  Msg#: 448                                          Date: 10 Jul 95  17:32:00
  From: Clay Cherneff                                Read: Yes    Replied: No
    To: Vic Tosca                                    Mark:
  Subj: Help- batch to delete files

 -=> Quoting Vic Tosca to All <=-


 VT> for %%a in (%drives%) do dir %%a\.bak /s/b >>c:\del-list.fil

 VT> how can I call up the filenames that are stored in DEL-LIST.FIL and
 VT> cause them to be deleted? Is there a way? I'm using MS-DOS v5.0.

 Using QBasic (included with DOS 5.0)...

 KILLEM.BAS

 OPEN "C:\DEL-LIST.FIL" FOR INPUT AS #1
    DO UNTIL (EOF(1))
       LINE INPUT #1, DELFILE$
       SHELL "DEL " + DELFILE$
    LOOP
 CLOSE #1
 PRINT "All files listed in DEL-LIST.TXT have been deleted..."
 SYSTEM

 To run it from your housekeeping batch file...

 QBASIC /RUN KILLEM

 Hope that helps...

 Clay

... What do you mean? You actually read this Tagline?!?
-!- Blue Wave/SBBS v2.12 [NR]
 ! Origin: Mystic Runes 28.8 DS V.Everything [604]746-0156 (1:340/207.0)


 Area: Batch Language Programming                     FI 
  Msg#: 433                                          Date: 11 Jul 95  15:50:32
  From: Matthew Lewis                                Read: Yes    Replied: No
    To: Rick Viscusi                                 Mark:
  Subj: Multi-Config  (Part 1)

Hello Rick,

At 17:45, 10 Jul 95, Rick Viscusi wrote to Matthew Lewis:

ML>> when using the DOS 6+ multi-config option,

RV>     Multi-config, what is this all about?

Multi-config setups are nothing new to many denizens of BATPOWER, and others
who play with the setup of their computers.

Prior to the release of MS-DOS version 6.0, it was most often done with a batch
file that would copy alternate Autoexec.Bat and Config.Sys files to the root
directory of the boot drive, or by booting from a floppy disk set up for a
particular configuration.

With the release of MS-DOS 6.0, Microsoft included a new feature, which some,
including myself, feel is one of their brighter ideas.

This feature allows you to include a MENU in your Config.Sys file, which will
allow you up to 9 choices of how you want to boot the system.  Any of these 9
can also be a SUBMENU offering another 9 choices.  A SUBMENU can also have more
SUBMENUs.

I don't know if there's a limit to how many levels deep you can go with these
SUBMENUs, but I've successfully gone 5 levels deep with no problems while just
playing with it to see what could be done.

The possibilities are limited only by your imagination.

Indeed, one of Microsoft's brighter ideas.

Here's how it works, showing some examples from my own configuration for the
machine I'm using at the moment.  They're totally different on each of my
computers.

Here are the first few lines of my Config.Sys file:

        [MENU]
        MENUCOLOR=14,4
        MENUITEM=Bbs, Flossie's Saloon {2}
        SUBMENU=Links, LINKS Golf
        MENUITEM=Win, Microsloth Windoze 3.1
        SUBMENU=MS-DOS, MS-DOS 6.20
        MENUITEM=Test, System Test & Maintenance
        MENUDEFAULT=Bbs, 15

That first line tells DOS that this is a menu.  You can have only one "[MENU]"
line in Config.Sys, and though not certain, I believe it must be the very first
line.

Next, MENUCOLOR sets the colors (logical)  14,4 gives me bright yellow text on
a red background.  This immediately gets my attention, and I find it easy to
read.  You can use any color combination that looks good to you.  This line is
optional.

The next 5 lines (MENUITEM & SUBMENU) are the choices what will appear on the
screen.  The part after the equals sign and before the comma, is the actual
name of that configuration or submenu.  It's also known as a block name.  More
on "Blocks" later.  The part after the comma is the text that will appear on
the screen.  I believe it's limited to 60 characters.  You can have up to 9
choices per menu.

The last line above (MENUDEFAULT) is optional.  If used, that menu choice will
be highlighted.  If not used, the first choice will be highlighted.  The comma
and following number are optional.  If used, that choice will automatically be
selected after that number of seconds.  If a zero is used, that choice will
immediately be selected, and you won't even see the menu.

When the system boots, the menu will be displayed.  If a time was specified on
the MENUDEFAULT line, you'll see a countdown timer.

At this point, hitting the Enter key will select the highlighted item, which is
the default.  If you want a different choice, just move the highlight bar with
the up/down arrow keys, or type its number, and hit Enter to select it.

Ok, I guess it's time to explain "Blocks" now.

You build your Config.Sys file with "Blocks."  Any line enclosed in square
brackets is a "Blockname" and all lines below it, until the next "Blockname"
are a part of that "Block."  Simple, eh?

Blocknames are like labels in a batch file.  When you select a choice from the
menu, Config.Sys branches (jumps) to that Block, and executes those lines.  It
also sets the environment variable CONFIG to that Blockname.  This comes in
very handy later on, when we get into Autoexec.Bat.

I'm starting to go a bit long here, so I'll continue in "Part 2" of this
message.

Wouldn't want to exceed the dreaded 99 line limit of some older readers.

                                Matthew.....

-!-
 ! Origin: Flossie's Saloon & BFDS Site * Calgary * 1-403-262-5998 (1:134/32)


 Area: Batch Language Programming                     FI 
  Msg#: 434                                          Date: 11 Jul 95  15:51:06
  From: Matthew Lewis                                Read: Yes    Replied: No
    To: Rick Viscusi                                 Mark:
  Subj: Multi-Config  (Part 2)

Hello Rick,

Continuing from where I left off in Part 1 of this message.

Here's my [Links] block:

        [Links]
        MENUITEM=Lj, Play with Joystick
        MENUITEM=Lm, Play with Mouse
        SUBMENU=MENU, Return to Main Menu
        MENUDEFAULT=Lm

I've got 3 choices on this SUBMENU.  The third is one I've not seen documented
anywhere, but decided to try several months ago, as the structure of the main
menu and submenus are the same.  Sure enough, it worked, and I've been using it
ever since as a convenient "Bail-Out" which takes me back to the very top
should I decide I didn't really want to do that anyway.

Note there's no time specified on the MENUDEFAULT line.  That feature doesn't
work in submenus, but it will still highlight the default, so pressing the
Enter key will still select it.

"Play with Mouse" is now highlighted, but I want to use the joystick instead,
so I either type a "1" or hit the up arrow key to select the first choice, and
then hit the Enter key, and it branches to my [Lj] block.

        [Lj]
        DEVICE=C:\DOS\SETVER.EXE
        DEVICE=C:\DOS\HIMEM.SYS
        DEVICE=C:\DOS\RAMDRIVE.SYS 1600 /E
        DEVICE=C:\BIN\TANSI.SYS
        DOS=HIGH
        BUFFERS=40
        FILES=32
        LASTDRIVE=D
        SET CONFIG=Links
        SHELL=C:\DOS\COMMAND.COM C:\DOS\ /E:256 /P
        STACKS=0,0

This looks pretty much like a run-of-the-mill Config.Sys file, except for that
"SET" command, doesn't it?

Beginning with MS-DOS version 6.0, you can use the SET command to set
environment variables from Config.Sys rather from a batch file later.

I don't recommend this as a normal practice, as it will cause memory to be
wasted later on, but Config.Sys has already set the CONFIG variable to "[Lj]"
so I'm only adding 3 bytes here, and it will save me some work later on.

If I had selected to play with the mouse instead of the joystick, the SUBMENU
would have branched to my [Lm] block instead.

        [Lm]
        INCLUDE=Lj
        DEVICE=C:\BIN\MOUSE.SYS /3K /BHIGH /S02 /DLEFT /CENHANCE /COFF /1

That INCLUDE command can save you a lot of typing.  This block executes all the
commands in my [Lj] block, and loads my mouse driver, which is the only
difference between the two configurations.

Whoever came up with the idea for Microsoft's Multi-Config is starting to sound
even brighter now.  Pity they don't have a few more like him.

Finally, after several more "Blocks" we get down to the bottom of the
Config.Sys file, where we find:

        [COMMON]
        NUMLOCK=OFF

Any commands in the [COMMON] block will be included every time you boot.

That's the only command I use in ALL of my configurations, but you can include
as many as you wish to, or even leave this block out if you have no common
commands.

That's pretty well all there is to setting up a Multi-Config Config.Sys file.

All the details, and several examples can easily be found by going to your DOS
prompt and typing:

        HELP MULTI-CONFIG

This will even give you more information than the printed manual.

Looks like I better start a "Part 3" to explain the various options available
in Autoexec.Bat, though some readers will have already figured that out on
their own.  I've given them sufficient clues.

                                Matthew.....

-!-
 ! Origin: Flossie's Saloon & BFDS Site * Calgary * 1-403-262-5998 (1:134/32)


 Area: Batch Language Programming                     FI 
  Msg#: 435                                          Date: 11 Jul 95  16:31:44
  From: Matthew Lewis                                Read: Yes    Replied: No
    To: Rick Viscusi                                 Mark:
  Subj: Multi-Config  (Part 3)

Hello Rick,

Continuing from Part 2 (this should finish it) ...

Now that we're done with Config.Sys, it's on to Autoexec.Bat, a subject
slightly more "On-Topic" for the echo.     ;-)

Remember those "Blocknames" we used in Config.Sys ?

The one we chose to boot with is now available to us as the CONFIG environment
variable, unless we changed that variable with a SET command in Config.Sys.

This gives a lot of decision making power in Autoexec.Bat.

Microsoft suggests using the IF command, and/or the GOTO command with labels
having the same names as your Blocknames.

Any place in a batch file where you use the string "%CONFIG%" (without the
quotes)  DOS will substitute the contents of the CONFIG variable, which is your
Blockname, unless you changed it.

You could use commands like these:

        If %CONFIG% == Win C:\Dos\Smartdrv
        If not %CONFIG% == Win d:\path\load some other cache
        and so on ...

Or do it this way:

        This gets done on every boot
        That gets done on every boot too
        Some other thing gets done all the time as well
        GOTO %CONFIG%
        :Win
        rem     do all your Windows setup stuff here
        win
        goto end
        :WP
        rem     setup WordPerfect here
        wp
        goto end
        :Links
        rem     off to the golf course
        goto end
        :BBS
        rem     do setup
        bbs.bat
        :Test
        rem     setup Test configuration here
        :end

Note that I didn't include a "goto end" after starting the BBS.  If the command
you use to start a program is another batch file, you don't need it.

If, on the other hand, I had left out the "goto end" commands below the :Win,
:WP, and :Links labels, and booted up to run Windows, when I exited Windows, it
would load WordPerfect, followed by Links, and finally try to run the BBS.

Well, I went and figured out yet another way that Microsoft didn't suggest.

Create a separate "Autoexec.Bat" for each of your configuration options, but
give them names the same as your Blocknames, like Win.Bat, BBS,Bat, Links.Bat,
and so on.  Keep the root directory a bit cleaner by putting them all in a
subdirectory (C:\BOOT is a logical choice) then you can have an Autoexec.Bat
file in the root directory with the single line:

        @C:\Boot\%CONFIG%

I've done it this way (almost).  There are a few things I want to do EVERY time
I boot, so I put those commands in my Autoexec.Bat file, which uses the above
line as its last line.

There's nothing difficult at all about this Multi-Config thing, but it does
require a bit of work on your part to put it all together.

I happen to feel it's worth the extra work, as it allows me to boot up with a
configuration that's optimized for whatever application I want to run at the
time.

It's not for everyone, but for those who take the time to set it up, it can
make life with a computer much friendlier.

A final note about "Blocknames."  They can be up to 70 characters long, but if
you want to use them later as labels, only the first 8 characters are
significant (first 40 for 4DOS or NDOS).

If you want to use them later as filenames, the maximum is 8 characters.

And a final, final note, on Config.Sys.  It seems that the [MENU] line does NOT
need to be the first line in Config.Sys, but anything above it will be executed
with every boot.  (read through the help file again)

                                Matthew.....

-!-
 ! Origin: Flossie's Saloon & BFDS Site * Calgary * 1-403-262-5998 (1:134/32)


 Area: Batch Language Programming                     FI 
  Msg#: 439                                          Date: 23 Jul 95  00:04:50
  From: Matthew Lewis                                Read: Yes    Replied: No
    To: All                                          Mark:
  Subj: Volunteer(s) Wanted

"Ok men, I need a volunteer or two."

Oh, how I trembled at the sound of those words as a young sailor thirty some
years ago.

Well, this isn't going to be quite so bad as all that.

I had an idea Saturday afternoon for something I'd like to see someone put
together, sort of a "Best of BATPOWER" or "BATPOWER Archives."

It would be compiled on a monthly basis, and would include text file copies of
some of the more informative messages from the BATPOWER echo, with each message
as a separate file (all parts of a multi-part message in a single file.)

Scripts for program files would be deleted from the message texts, leaving only
any descriptive text, and the actual programs the scripts create would be
included within the same archive as the message text files.

The size of the monthly archive files should be kept to about 60 or 70K tops,
to allow for 14.4k transfers in an under one minute phone call.

If archive size permits, some of the older gems could be included from time to
time to bring the archive up to the maximum size.  I'm thinking of things like
Rob Flor's P2E.COM and ALTER.EXE, and some of those other little greats that
have been around for a few years, but have had nothing better come along to
replace them.

The monthly archives would be released with a fixed filename format similar to
other periodic files.  Something like BPARCnnn.ZIP (or .LZH) where "nnn"
translates to the date of release, or a sequential number starting with 001.

Though I haven't spoken with him about this, I'm sure we could get Dennis
Powers to distribute via the BFDS file area, and I could probably arrange for
distribution via another file distribution network as well.

This is a project that I'm sure Bat Lang and/or I could handle, but I'm certain
that someone else out there could do just as good a job, and quite possibly
better.

I think it would be best handled as a group effort by 3 or 4 echo participants,
one of the old timers, a newcomer, and 1 or 2 somewhere in between.  What seems
"Best" to one of the old timers might seem to complex for the newcomers to
understand, and what seems "Best" to a newcomer may have been seen so many
times by the old timer that he doesn't even notice it the umpteenth time it
goes by.

Anyway, those are my thoughts on it.

Any comments?  Ideas?  Volunteers maybe?

I KNOW that we've got enough talent here in BATPOWER to put together a really
"First Class" electronic periodical, and there's certainly no shortage of
suitable material in the echo.  Once a month might not be often enough though.

So who wants to pick up this ball and run with it?


                                Matthew.....

-!-
 ! Origin: Flossie's BATPOWER Saloon * Calgary, AB * 403-262-5998 * (1:134/32)


 Area: Batch Language Programming                     FI 
  Msg#: 444                                          Date: 24 Jul 95  21:45:02
  From: Gerry Pareja                                 Read: Yes    Replied: No
    To: Mike Jabour                                  Mark:
  Subj: Batch files and dates

MJ>I have my daily BBS Batch file maintanance every morning, and I was
wondering
MJ>if I could have it update my FD.LOG file in such a way that

MJ>:menuitem1
MJ>  <do task in here>
MJ>  <do task in here>
MJ>echo Menuitem1 has been completed successfully >> c:\ra\logs\progress.txt

MJ>Is there any way to make it do something like this:

MJ>+ HH:MM:SS  Menu Item Done...

 Yes, of course.  This little BAT file will do it:

 This allows up to 8 words for comments (change filenames as needed; in
 fact you can make the BOOT.LOG file be a variable. Left as an exercise
 for the reader :)

 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
 :: LOG.BAT
 :: Thanks to Steve Reid of Squamish, B.C. for this method:
 @if "%1"=="XXX" prompt $d @ $t$h$h$h %2 %3 %4 %5 %6 %7 %8 %9
 @if "%1"=="XXX" goto end
 @echo off
 %comspec% /c %0 XXX %1 %2 %3 %4 %5 %6 %7 %8|find ":">>c:\boot.log
 :end
 :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

 Sample call:

 CALL LOG.BAT Project #1

 Sample output:

 Wed 04-26-1995 @  9:57:09.76
 Wed 04-26-1995 @ 10:22:11.97 Computer booted in DOS configuration
 Wed 04-26-1995 @ 10:22:28.18 Computer booted in Windows configuration
 Wed 04-26-1995 @ 10:22:36.20 Exited Windows
 Wed 04-26-1995 @ 10:22:49.82 Project #1
 Wed 04-26-1995 @ 10:23:10.14 Project for ZYX Inc.

 etc.etc.

 You can also add a few "backspace" characters to $t to get rid of the
 seconds and/or hundreds of seconds (they'll be there but won't show on
 screen):

 @if "%1"=="XXX" prompt $d @ $t$h$h$h %2 %3 %4 %5 %6 %7 %8 %9


 Gerry


 * OLX 2.1 TD * G. Pareja * Vancouver * B.C. * Canada *

-!- Maximus 2.02
 ! Origin: VKUG/VPCC Batpower Echo - Richmond, BC (1:153/151)


 Area: Batch Language Programming                     FI 
  Msg#: 443                                          Date: 27 Jul 95  09:32:03
  From: Raphael Neve                                 Read: Yes    Replied: No
    To: KYLE DUSANG                                  Mark:
  Subj: errorlevel

KYLE DUSANG wrote in a message to ALL:

 KD>      @ECHO OFF
 KD>      CHOICE /N /C:1234 "Enter 1,2,3, or 4"
 KD>      FOR %%q IN (4 3 2 1) DO IF ERRORLEVEL=%%q SET PIG=%%q
 KD>      GOTO %PIG%
 KD>      :1
 KD>      ECHO #1
 KD>      GOTO end
 KD>      :2
 KD>      ECHO #2
 KD>      GOTO end
 KD>      :3
 KD>      ECHO #3
 KD>      GOTO end
 KD>      :4
 KD>      ECHO #4
 KD>      :end

Yeah, I reckon you didn't fully understand errorlevels. The hitch is that if
you've got 04 in AL (which means your errorlevel's 4) the following statements
will all be executed: if errorlevel 3, if errorlevel 2, if errorlevel 1. I see
that you put the errorlevels in reverse order, so you must have some notion of
this, so I'll not explain any more. I would say you basically have 2 choices.

1)  choice [blah, blah, blah]
    if errorlevel 4 goto 4
    if errorlevel 3 goto 3
    if errorlevel 2 goto 2
    :: assume errorlevel 1
    echo First choice
    goto end
    :2
    echo Second choice
    [etc...]

    That's the easiest and most direct way.

2)  set pig=                                  (why pig? <g>)
    choice [blah, blah]
    for %%a in (1 2 3 4) do if errorlevel %%a set pig=%pig%o
    goto %pig%
    :o
    echo First choice
    goto end
    :oo
    echo Second choice
    goto end
    :ooo
    echo Third choice
    goto end
    :oooo
    echo Fourth choice
    :end

    This way is of course much slicker, but you'll have to rename your labels
to have a certain amount of 'o' which correspond to the choice number.

Regards from France,
Raph.

-!- FMail 0.96
 ! Origin:  Canada Dry BBS - France * 3 lines on 47.29.33.85  (2:321/1)


 Area: Batch Language Programming                     FI 
  Msg#: 450             Local                        Date: 03 Aug 95  14:24:28
  From: Bat Lang                                     Read: Yes    Replied: No
    To: All                                          Mark:
  Subj: The Truth about the BAtch File "IF" Command

 -=> Quoting Michael Howard to All, {02 Aug 95  01:41:00} <=-

                 [...much garbage removed...]

 MH>  ! Origin: -= Aviv_BBS [CiCS_5]
 MH> +972-3-6417720 28.8 Multi-Line =- (2:403/111)

Hopefully, all of you will overlook this obvious gaff.  I have asked his
Sysop to help him.

If everyone can resist the impulse to reply to these, and other
non-topical msgs, the $upporting Sysops will be grateful, and the echo
runs a bit smoother.  Rest assured, your moderators are up to handling
these.  Thanks, and Good Modeming!  /\oo/\

... Fido NetMail: 1:382/1201, or Internet: bat@infomail.com
-!- Blue Wave/Max v2.12
 ! Origin: The HUB * Austin TX * Centex PCUG * 512-346-1852 (1:382/1201)


 Area: Batch Language Programming                     FI 
  Msg#: 447                                          Date: 20 Aug 95  08:03:34
  From: Jim Mathis                                   Read: Yes    Replied: No
    To: Carlo Mosti                                  Mark:
  Subj: blank lines...

Hello Carlo!

17 Aug 95 01:12, Carlo Mosti wrote to Jim Mathis:
 CM>         Simply type:
 CM>         FIND /I " " SOURCE.EXT > TARGET.EXT
Yep, that worked.  I was trying to make it more complicated than it was.  I was
trying alt-255 instead of a simple space.

Thanks for the comeback!

Jim

-!- GoldED/P32 2.42.G0214
 ! Origin: Wits' End BBS-Bilingual Digits-(901)454-7927  (1:123/63)


 Area: Batch Language Programming                     FI 
  Msg#: 431                                          Date: 20 Aug 95  03:18:00
  From: John Scheuer                                 Read: Yes    Replied: No
    To: Michel Bertler                               Mark:
  Subj: Re: Tsr "mark & release"

 -=> Quoting Michel Bertler <=-

 MB> I've used "mark & release" for quite a while with no problem in
 MB> conventional memory, but these won't release any tsr loaded in high
 MB> memory! Is there any utility that could free high memory loaded tsr?

Try . . .

lh mark
lh [your program]
lh release

Works for me.

... Dar's House '13' BBS (610)543-1562 running Renegade at 14.4 w/RIP
-=- Blue Wave/QWK v2.12

-!- SLMAIL v4.5a  (#4157)
 ! Origin: Tara BBS (1:273/432)


 Area: Batch Language Programming                     FI 
  Msg#: 435                                          Date: 26 Aug 95  18:59:30
  From: DownBoy                                      Read: Yes    Replied: No 
    To: Micheal Ly                                   Mark:                     
  Subj: question on password

DM> Well I wanted to setup up a password in a bat file. I don't even
DM> if this can be done. But all I want it to do is ask a for an input of cer
DM> letters or number (password), and if the password is correct continue wit
DM> bat if not cancel the bat job.

DM>        Just off the top of the head, could you use choice to
DM>        sequence the user through a series of letters/numbers?

Saw your msg., decided to play around with CHOICE, and yes, there is a
way.  But if you share your utility, unless others have DOS 6.0 (or is
it 6.2?), they can't run it.  I recommend using freebie batch enhancers
to allow a wider range of other users to run your batch utilities.

But before I show you how to use CHOICE for passwords, let me suggest a
batch enhancement utility by that ever-popular batch dominatrix from
Finland, Timo Salmi.  This is the utility called ASKENV.COM,  with its
help message:

   ---------------------------------------------------------------------

   ASKENV, Copyright (c) by Prof. Timo Salmi, (Ver. 1.0) 20-Oct-91
   Address: School of Business Studies, University of Vaasa, Finland
   Email: InterNet: ts@chyde.uwasa.fi  FuNet: gado::salmi
   BitNet: salmi@finfun

   A common batch file enhancer returning as ASKENV environment variable
   the user's response.

   An example of a simple batch utilizing ASKENV:
   echo off
   ASKENV Yes or no? /l
   if "%askenv%"=="yes" echo It was a yes
   if "%askenv%"=="no"  echo It was a no
   echo on

   Usage: ASKENV [Prompt] [/b] [/l] [/u]
                            |    |    +- convert to Upper case
                            |    +- convert to Lower case
                            +- Batch mode (needed only if no prompt)

   Acknowledgment: The procedure that sets the value of the environment
   variable is based on a PD code by Drew Eckhardt.
   ---------------------------------------------------------------------

(If you exclude the /l or /u switch, you then make the user's response
case sensitive...very handy for higher security password protection.)
Now here is my batch file using ASKENV, with "banana" for the password:

___---------------------------------------------------------------------
ECHO OFF
CLS

ASKENV Type the password: /l

  if "%askenv%"=="banana" goto yes

goto no

:yes
cls
echo Password is correct.
goto end

:no
cls
echo Sorry, that's not the password.

:end
SET ASKENV=

___---------------------------------------------------------------------

Of course, you must secure the batch file from prying eyes, else a
clever tinkerer can see the password.

Now, in a moment (unless you're a very slow reader, or you actually
attempt to understand what I'm about to say <-8), you will see the batch
file I created, using CHOICE to determine the password.  It is set for a
2-character password, which in this case is "74".  I have structured it
so that, even when the first character guessed is wrong, the program
will proceed as if nothing were amiss, and ask for the next character.
That way, it will be much more difficult for the user to deduct the
password through trial and error.  Naturally, you can extend the CHOICE
subroutines for as long a password as you want, including alphabetic and
even symbolic characters in the password.  With my technique, the user
will be taken through every level of character-guessing until the last
level...regardless of whether any one or all of each level was correctly
or incorrectly guessed...so that the user will never know if the
password is wrong until the final choice.

I just included numbers 0-9 in this example, so the password is strictly
numerical.  But if you want to include letters, you must include the
whole alphabet on the CHOICE command line, so that the user won't be
alerted that s/he made a wrong guess on any particular level.  The
command line, if it includes numbers *and the alphabet, looks like so:

CHOICE "Type next character of password:  " /C:0123456789ABCDEFGHIJKLMNO
  PQRSTUVWXYZ /N /T:0,45

Of course, you can't break the command line as I did (for the sake of
message format)...it must all be on one line.  I haven't checked if DOS
allows a batch file to have one command line this long...or how, if at
all, you can break a line that DOS will still accept as a single command
line.  (Maybe someone out there can chime in?)

If you need help composing a password of any length, using CHOICE, let
me know, and I'll be glad to create it.  Here is my 2-character password
example (in my next message):


 * SLMR 2.1a * !!! This tagline is shareware (send $1) !!!
___
 X SLMR 2.1a X 

-!- Maximus 2.02
 ! Origin: realitycheckBBS-San Francisco,CA +1 415 648 9489 (1:161/418)


 Area: Batch Language Programming                     FI 
  Msg#: 436                                          Date: 26 Aug 95  19:25:32
  From: DownBoy                                      Read: Yes    Replied: No 
    To: Micheal Ly                                   Mark:                     
  Subj: question on password

GOTO BEGIN

This is a sample batch file, showing how to use CHOICE command
to create password security.  The user is asked for the password
character-by-character.  This example uses a simple 2-number password,
"74".  But I believe you can see from this example, how to develop it
into a password of more characters, including the alphabetic and
symbolic characters.

NOTE:  This batch file is ready to go, as is.  Just cut & paste this
entire message and give it a batch file name, such as PASSWORD.BAT.
You must, however, first remove the SLMR tagline at the bottom of this
message, as it will confuse DOS (but won't do any damage).  Just delete
everything below the last REM line that says:  "delete everything below
this line before running program."
___---------------------------------------------------------------------

:BEGIN

@ECHO OFF
CLS

CHOICE "Type first character of password:  " /C:0123456789 /N /T:0,45
IF ERRORLEVEL 10 GOTO WRONG1
IF ERRORLEVEL 9 GOTO WRONG1
IF ERRORLEVEL 8 GOTO NEXT1
IF ERRORLEVEL 7 GOTO WRONG1
IF ERRORLEVEL 6 GOTO WRONG1
IF ERRORLEVEL 5 GOTO WRONG1
IF ERRORLEVEL 4 GOTO WRONG1
IF ERRORLEVEL 3 GOTO WRONG1
IF ERRORLEVEL 2 GOTO WRONG1
IF ERRORLEVEL 1 GOTO WRONG1
IF ERRORLEVEL 0 GOTO WRONG1

:NEXT1
cls
CHOICE "Type next character of password:  " /C:0123456789 /N /T:0,45
IF ERRORLEVEL 10 GOTO WRONG2
IF ERRORLEVEL 9 GOTO WRONG2
IF ERRORLEVEL 8 GOTO WRONG2
IF ERRORLEVEL 7 GOTO WRONG2
IF ERRORLEVEL 6 GOTO WRONG2
IF ERRORLEVEL 5 GOTO NEXT2
IF ERRORLEVEL 4 GOTO WRONG2
IF ERRORLEVEL 3 GOTO WRONG2
IF ERRORLEVEL 2 GOTO WRONG2
IF ERRORLEVEL 1 GOTO WRONG2
IF ERRORLEVEL 0 GOTO WRONG2

:NEXT2
cls
GOTO YES

:WRONG1
cls
CHOICE "Type next character of password:  " /C:0123456789 /N /T:0,45
IF ERRORLEVEL 10 GOTO WRONG2
IF ERRORLEVEL 9 GOTO WRONG2
IF ERRORLEVEL 8 GOTO WRONG2
IF ERRORLEVEL 7 GOTO WRONG2
IF ERRORLEVEL 6 GOTO WRONG2
IF ERRORLEVEL 5 GOTO WRONG2
IF ERRORLEVEL 4 GOTO WRONG2
IF ERRORLEVEL 3 GOTO WRONG2
IF ERRORLEVEL 2 GOTO WRONG2
IF ERRORLEVEL 1 GOTO WRONG2
IF ERRORLEVEL 0 GOTO WRONG2

:WRONG2
cls
GOTO NO

:YES
CLS
ECHO Hurrah!  You got the password!
GOTO END

:NO
CLS
ECHO Sorry, wrong password.

:END
ECHO.
rem !! DELETE EVERYTHING BELOW THIS LINE, BEFORE RUNNING PROGRAM.

___
 X SLMR 2.1a X 

-!- Maximus 2.02
 ! Origin: realitycheckBBS-San Francisco,CA +1 415 648 9489 (1:161/418)


 Area: Batch Language Programming                     FI 
  Msg#: 437                                          Date: 30 Aug 95  00:00:04
  From: James Lee                                    Read: Yes    Replied: No 
    To: Lori Duquette                                Mark:                     
  Subj: Trim var & create file?

 <** On 08-10-95, Lori Duquette said to All: **>
LD>I have been lurking for some time, but I haven't noticed a solution to 
LD>my problem - can you BAT gurus help?
LD>(Netware 3.12 & 4.1,  mostly MS-DOS 5.x & 6.x)
LD>The network card address (i.e. 0000C0AFDEC0) is already fed into a DOS 
LD>environment variable. Using invisible-to-the-user batch file ONLY, I
LD>need to create a decent filename.
LD>I guess I  want to trim the first 4 characters (they're ALWAYS zeros) 
LD>and then assign the remaining 8 characters as the filename (the 
LD>extension doesn't matter to me).
LD>Can  FOR IN DO  do this, somehow?  I'm stumped!
LD>And, thanks in advance for any suggestions...
LD>

As i understand it, u want to take whatever the network card address is,
trim the first four characters off (0's), then have a filename that contains
that last 8...this batch will assume that the card address is in the env/var
cardaddr, and will modify cardaddr so that it only contains the last eight
characters plus a generic extension, the env/var and/or extensions can be
changed to suit your needs:

___
@echo off
if (%1)==(recurse) goto recurse
for %%a in (1 2 3 4) do call %0 recurse
:: *.XXX is the generic extension
set cardaddr=%cardaddr%.XXX
goto end
:recurse
for %%a in (/%cardaddr%) do set cardaddr=%%a
:end
___

simple, eh?

 James...

-!-
 X VbReader 2.22 #NR X Ok, now for a quick backu+A+&2#^1s=

-!- Maximus/2 2.01wb
 ! Origin: Workplace Connection * (317) 742-2680 (1:201/60)


 Area: Batch Language Programming                     FI 
  Msg#: 439                                          Date: 31 Aug 95  15:46:00
  From: Larry Nelson                                 Read: Yes    Replied: No 
    To: All                                          Mark:                     
  Subj: Chkdsk

         ALL:

      Here's something......

         chkdsk/v|find/v/i "directory"|find/c "C:\"

      Will give you a count of every file on c:. And......

         chkdsk/v|find/v/i "directory"|find "C:\">file.lst

      Will give you a list showing the full path to each of those
      files in a file named File.lst.
         
 :L8r
            Larry
            .......In a pinch a stone ax still works......


-!- Maximus 2.02
 ! Origin: MSDOS MAXIMUS BBS (1:343/101)


 Area: Batch Language Programming                     FI 
  Msg#: 428                                          Date: 01 Sep 95  09:35:00
  From: Gerry Pareja                                 Read: Yes    Replied: No 
    To: Larry Nelson                                 Mark:                     
  Subj: Nud8.bat

LN>      Nud8.bat changes the date/time stamp on a given file

 Funny name you chose, Larry.  I was thinking it had something to do
 with "nudity" etc.  Wonder what's been on my mind lately ;-)

LN>      to the date and time set by parameters %2 and %3.
LN>      Nud8 was written with DOS6.2. I don't know when the
LN>      "copy (filename.ext)+,," trick came into being so I'm
LN>      leaving the users of other versions the task of
LN>      testing Nud8 for their systems.

 For sure it'll work in MS-DOS 5.00.  Can't test others.

LN>   echo Now setting %1......%2  %3.
LN>   echo %2|date>nul
LN>   echo %3|time>nul

 Hmmm, after all this time here, you haven't picked up on a neat little
 shortcut of DATE/TIME:

 date %2
 time %3

 will do the same job as

 echo %2|date>nul
 echo %3|time>nul

 but without the pipe "|" operations.  No redirection to "NUL:"
 required.

 Gerry


 * OLX 2.1 TD * G. Pareja * Vancouver * B.C. * Canada *

-!- Maximus 2.02
 ! Origin: VKUG/VPCC Batpower Echo - Richmond, BC (1:153/151)


 Area: Batch Language Programming                     FI 
  Msg#: 450                                          Date: 03 Sep 95  07:41:00
  From: KYLE DUSANG                                  Read: Yes    Replied: No 
    To: ALL                                          Mark:                     
  Subj: cool bat

Hello All,
   The following bat was written by the great Hardin Brothers and was
printed in DOS World mag. I stumbled across it soon after I first got
my computer and the sheer genius of it is what peaked my interest in
batch.
   GetInfo.bat captures a veritable plethora of info from the prompt
display and stores it all in envars. It nabs the current time; date;
path; DOS version; and drive and stuffs them into the environment so you
can use them in your bats for just about anything.
   This is not exactly as it was originally printed but the technique is
the same.


GETINFO.BAT  by Hardin Brothers
-------------------------------------------
@echo off
cls
if not "%1"=="" goto saveall
echo @prompt %0 $t $d $p $v $n >c:\bat\temp1.bat
command /c c:\bat\temp1.bat > c:\bat\temp2.bat
c:\bat\temp2.bat
:saveall
set time=%1
set day=%2
set date=%3
set curpath=%4
set dosver=%5 %6 %7
set curdrv=%8
del c:\bat\temp1.bat
del c:\bat\temp2.bat
---------------------------------------------
   Here's what goes on, as I see it. The secret is the command /c
command in line 5. This starts a new copy of command.com for just
one command. That command calls a bat that was created in the
previous line and contains the command to define the new temporary
prompt which will consist of the name of the parent bat (%0) and all
of the info we're trying to grab. The output of all this noise,
which is "Getinfo Sun 09-03-1995, etc." is then stuffed into yet
another temporary bat (Temp2.bat) which is in turn called in the
next line. Temp2.bat calls the parent, Getinfo.bat, along with its
new parameters. The if-not statement at the beginning tells it to
now go save these parameters into the envir. and then cleanup.
   Pretty cool, huh? This info can be used to do things like return
to the current drive when a bat finishes if you changed dirs from within
the bat. I use it to automatically set the date when I warm boot my xt
cuz I don't have a cmos battery in it. That is providing I've set the
date once at morning boot up. This is determined by a choice statement
in my bat, but answering Y with one keystroke is a lot easier than
setting the date the old fashioned way if and when I reboot. Anyway,
that bat is another story. If anyone's interested, let me know and I'll
tell more.
   Try Getinfo.bat and then type 'set' and see what goodies you'll
have in your envir. One final note, the way I have it written assumes
you have a directory called c:\bat. If not just change everywhere it
says 'c:\bat' to wherever you want. I use the find and replace feature
in the DOS Editor for that sorta thing.
   Well, I've rambled enough. Lemme know if anyone finds this as useful
as myself.
========
Cya,
]{yle

 * SLMR 2.1 * Beware of dragons, for thou art crunchy.
-!- Platinum Xpress/Wildcat! v1.0j
 ! Origin: home of WcEDIT!/PostMaster/WCToday! (1:390/3)


 Area: Batch Language Programming                     FI 
  Msg#: 442                                          Date: 02 Sep 95  19:20:12
  From: Greg Miskelly                                Read: Yes    Replied: No 
    To: Bob Morton                                   Mark:                     
  Subj: Repeating List

 -=> Quoting Bob Morton to All <=-

Hi Bob

 BM> OK, gurus...here's your challenge:

Not a guru, just a fiddler.

 BM> I have a process that runs a variable number of times each day
 BM> (0 to about 30...depending on other events that happen randomly).
 BM> Each day, I need for each "run" of this process to use the next
 BM> number from a defined list. The same list is used each day.

No problem.

 BM> For example, the list might look like this:
 BM> 360
 BM> 432
 BM> 273
 BM> 366   etc up to 30 different numbers.

In my example below I have used 123, 234, 345, 456, etc.

 BM> The first run of each day should use 360; 2nd run use 432; etc.
 BM> To use these in my process, I can pick them up from an environment
 BM> variable or, possibly, as the filename from a zero-length file.

Neither will work in a secure manner.

 BM> The scheme must be robust enough to not lose its place across
 BM> power outages, system crashes, etc.

Now you're talking. Use a data file. That's the safe way to do it.

 BM> Ideas?   Regards...Bob Morton

How's this: it assumes that your batch files are in C:\BELFRY
- - - - - - - - - - - - - - - < cut > - - - - - - - - - - - - - - -
@echo off
rem DOLIST.BAT Performs an action on a list of numbers.
   if "%1 == "? goto help
   if "%1 == "/? goto help
   if "%1 == "/sub goto subroutine
   if exist current.bat goto tempfind
   if exist ~temp.bat goto tempfind
   echo.|date>~temp.bat
   echo set ~dldate=%%4>current.bat
   call ~temp
   del ~temp.bat
   del current.bat
   if not exist c:\belfry\~dolist.bat goto newday
   type c:\belfry\~dolist.bat|find "%~dldate%">nul
   if errorlevel 1 goto newday
:sameday
rem ****** Do all the numbers plus 1 extra dummy number 000 *****
   call c:\belfry\~dolist
   for %%a in (123 234 345 456 567 678) do call %0 /sub %%a
   for %%a in (789 890 987 876 765 000) do call %0 /sub %%a
   goto end
:newday
rem ****** Use the first Number Here ****************************
   echo set ~currno=123>c:\belfry\~dolist.bat
   echo rem %~dldate%>>c:\belfry\~dolist.bat
   goto sameday
:subroutine
   if not "%2 == "%~currno% goto end
rem ****** If Last Number, ie, the dummy number, Do a break *****
   if "%2 == "000 echo Last Number has been processed!
   if "%2 == "000 goto end
   if "%2 == "%~currno% echo Doing action on %2
   if "%2 == "%~currno% echo rem %~dldate%>c:\belfry\~dolist.bat
rem ****** Do the numbers last to first *************************
   if "%2 == "765 echo set ~currno=000>>c:\belfry\~dolist.bat
   if "%2 == "876 echo set ~currno=765>>c:\belfry\~dolist.bat
   if "%2 == "987 echo set ~currno=876>>c:\belfry\~dolist.bat
   if "%2 == "890 echo set ~currno=987>>c:\belfry\~dolist.bat
   if "%2 == "789 echo set ~currno=890>>c:\belfry\~dolist.bat
   if "%2 == "678 echo set ~currno=789>>c:\belfry\~dolist.bat
   if "%2 == "567 echo set ~currno=678>>c:\belfry\~dolist.bat
   if "%2 == "456 echo set ~currno=567>>c:\belfry\~dolist.bat
   if "%2 == "345 echo set ~currno=456>>c:\belfry\~dolist.bat
   if "%2 == "234 echo set ~currno=345>>c:\belfry\~dolist.bat
   if "%2 == "123 echo set ~currno=234>>c:\belfry\~dolist.bat
   goto end
:tempfind
   echo Error! Found temporary files
   goto end
:help
   echo DOLIST.BAT Sample program for Bob Morton
   echo Uses a data file C:\BELFRY\~DOLIST.BAT
   echo Syntax   DOLIST
:end
- - - - - - - - - - - - - - - < cut > - - - - - - - - - - - - - - -
That'll work okay. You'll have to put in your own numbers though.
Also, you'll have to put in the command line required where the
above does:

   if "%2 == "%~currno% echo Doing action on %2

Regards... Greg Miskelly - gmiskelly@nicts.dnet.co.uk
___ Blue Wave/QWK v2.12

-!- Maximus/2 2.01wb
 ! Origin: The MonuSci BBS (2:255/100)


 Area: Batch Language Programming                     FI 
  Msg#: 446                                          Date: 10 Sep 95  00:50:00
  From: Gary Smith                                   Read: Yes    Replied: No 
    To: Gary Earhart                                 Mark:                     
  Subj: PKUNZIP with a batch

GE>   I am looking for a way to pkunzip mutiple files with a batch file. I
  > receive usenet files daily from Planet Connect and need an effective
  > way to automate their processing.  A typical day will see a long list of
  > files;
  >                              PCUSENET.107
  >                              PCUSENET.108
  >                              PCUSENET.110
  >                                          Etc.
  >   There may be skips in the sequence, or have missing ones show up later.
  > What I would like to do is detect when these files begin to arrive (on H
  > drive), process them as they arrive( unzip them into *.bag files into my
  > spool directory on "M" drive) where the UUIN program can toss them to their
  > final destination ("N" drive). I can have an event check every hour for
  > the existance of the files, but I want to process them one at a time to
  > conserve disk space.

How's this for a beginning?

@echo off
:Loop
if not exist pcusenet.* goto Done
for %%F in (pcusenet.*) do if not exist pcusenet.$$$ ren %%F pcusenet.$$$
pkunzip pcusenet.$$$ ...
:: do whatever else is needed
del pcusenet.$$$
goto Loop
:Done
-!-
 * OLX 1.53 * Junk: Stuff we throw away.  Stuff: Junk we keep.

-!- WILDMAIL!/WC v4.12 
 ! Origin: The Computer Room-Pickerington, Oh  (1:226/110.0)


 Area: Batch Language Programming                     FI 
  Msg#: 450             Local                        Date: 14 Sep 95  01:52:16
  From: Bat Lang                                     Read: Yes    Replied: No 
    To: Eldridge Currie                              Mark:                     
  Subj: JULIAN.UUE

 -=> Quoting Eldridge Currie to Vic Tosca, [12 Sep 95  20:11:01] <=-

 EC> section 1 of uuencode 5.21 of file julian1.zip    by R.E.M.

 EC> begin 644 julian1.zip
                [... text deleted for brevity ...]

Eldridge, I have some problems with your posting of this script in the
echo.

1.  It was not requested by anyone.  It should only be posted as a
direct result of someone asking you to post it.  Otherwise, what is to
preclude 10 people all submitting scripts to do the same thing, all
generated from a single problem.

2.  It should not duplicate things that we have in the BFDS.  I had
already referred Vic to JULIAN2.ZIP at the BFDS sites.  Since your Net
has at least four of these sites, you might wish to compare yours to
that one.  I believe it will open your eyes.  It certainly did mine!  I
recently posted a listing of all those files under BFDSFILZ.

3.  It is not acceptable to script shareware in this echo.  There are
other venues for this, and it is unfair to the Sysops that $upport this
echo, that they should be underighting the movement of scripts that ask
for $$.  Particularly when the author is the one doing the scripting,
and much space is given up to advertising his BBS.  Only pgms that ask
for no $$ are appropriate here.

There is certainly nothing wrong with hatching it thru the BFDS, but
before you do that, I would recommend you take a look at what is already
there.  The BFDS sites in your net are: /527 /767 /797 & /798.

JULIAN2.ZIP      5582  01-04-95  JULIAN returns the day of year(Julian)
                                 using the system date, and inserts it
                                 into the environment Variable

Avail for 24hr freq-only, from my Origin, 3 lines, all USR DS, V.Ev's.

I request everyones consideration of these points, and ask that any
replies be made to Netmail or E-mail.  Thanks, and Good Modeming!
/\oo/\

BATPOWER, Moderator

... Fido NetMail: 1:382/1201, or E-mail: bat@infomail.com  
-!- Blue Wave/Max v2.12
 ! Origin: The HUB * Austin TX * Centex PCUG * 512-346-1852 (1:382/1201)


 Area: Batch Language Programming                     FI 
  Msg#: 442                                          Date: 25 Sep 95  20:28:34
  From: Larry Nelson                                 Read: Yes    Replied: No 
    To: Andy Mindarwi                                Mark:                     
  Subj: Nud8.bat

         ANDY:

 Subject: Nud8.bat

 LN> echo set dt=%%3>!.bat
                 ^^^---------Shouldn't this be %%2 for date?
 LN> echo set tm=%%4>>!.bat
                 ^^^---------And this %%3?
 LN> dir !.bat|find "!">magic.bat      } Can we just call !? If we can't, we
 LN> call magic                        } could change !.bat to something else

      To understand what is happening here you must understand how
      the Magic.bat works. The Magic.bat is a routine that has been
      developed to put a wide range of system data into  DOS environment
      variables (envars). In this case the system date and time are
      traped to envars. The first two lines load the lines.....

                set dt=%%3
      and...
                set tm=%%4

      into a file named !.bat. The third line loads a dir listing
      for !.bat....

                dir !.bat|find "!">magic.bat

      into a file named Magic.bat. The forth line calls Magic.bat
      and DOS reads the line.....

            !        BAT            11 09-26-95   7:58p

      and thinks that you want it to call !.bat with four parameters...

            BAT, 11, 09-26-95, and 7:58p

      and so it does. Inside !.bat are the two commands....

                set dt=%%3
      and...
                set tm=%%4

      Dos, per instruction, sets the envar dt to the third parameter
      which is 09-26-95, and then sets the envar tm to the forth
      parameter which is 7:58p. These are the parameters set when
                                ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Magic.bat called !.bat, and therein lies your confusion.
      ~~~~~~~~~~~~~~~~~~~~~~
      When NUD8.bat is called it is called with the name of the file
      you want redated as parameter one, the date you want this file
      to have as parameter two, and the time you want this file to have
      as parameter three.
      Nud8 first sets system to the values in %dt% and %tm% then
      changes the date/time stamp of the file named in parameter one.
      Then the system time and date is returned to current date/time
      by pipeing the second and third parameters to the date comand.

      The Magic.bat is a handy Batch tool. I hope I have helped you
      with it a bit.


 Subject: TabCost

 LN> 1. A majority of Batch files are written by people not fluent
 LN> in any other programing language.

 AM> Very not true. I know there are a lot of really kewl ppl who can
 AM> program in other languages, like BASIC, PASCAL, and even C, so batch
 AM> file programming is definitely not only done by non-other-programming-
 AM> language ppl. =)

      I suspect that you are a programer of whatever breed/s, and as such
      tend to hang with other programers. My experience, outside of
      BatPower, is that for every person I know that has a computer
      maybe 1 in 10 has written a program in any language other than
      Batch, and of the remaining 90 percent maybe 1 in 10 has written
      a Batch file more complex than two or three lines, (including
      @echo off).
:L8r
         Larry
         .......In a pinch a stone ax still works.......



-!- Maximus 2.02
 ! Origin: MSDOS MAXIMUS BBS (1:343/101)


 Area: Batch Language Programming                     FI 
  Msg#: 443                                          Date: 26 Sep 95  22:21:00
  From: David Adamson                                Read: Yes    Replied: No 
    To: Larry Anderson                               Mark:                     
  Subj: Does anyone?


 > Does anyone have a batch routine written that will pick a random
 > number. I can do it real easy using 4DOS, but some other people want to
 > do it in regular dos.  I think maybe it could be done using the time,
 > or peeking at a memory location. Is there any memory locations that
 > randomly generate a number?

Memory location 0046C(hex) has the DOS time. Here is a little progam
that uses it generate a number between 0 and 255.

-+-+--------------------------------------------------------------
n RANDOM.COM
e100 BA "2"1 E8 "&"0 1F A1 "l"4 B4 0 "P"BB A 0 B9 3 0 "3"D2 F7 F3
e117 83 C2 "0R"E2 F6 B9 3 0 B4 2 "Z"CD "!"E2 FB "X"B4 "L"CD "!"B4
e12D 9 CD "!"C3 0 "SET RANDOM=$"D A " David Adamson - BatPower "
rCX
5A
w
q  CRC32=7E5FCFDA * CSCRIPT 2.0 * PSEUDO-RANDOM NUMBER GENERATOR
-+-+--------------------------------------------------------------

 Save the script between the hash marks to an ASCII file.
 At the DOS prompt enter,  "DEBUG < filename"
 where "filename" is the name of the saved ASCII file.

-!- FMail 0.96
 ! Origin: david.adamson@p1.f7.n375.z1.fidonet.org (1:375/7.1)


 Area: Batch Language Programming                     FI 
  Msg#: 450             Local                        Date: 08 Oct 95  01:32:59
  From: Bat Lang                                     Read: Yes    Replied: No 
    To: Larry Anderson                               Mark:                     
  Subj: Load .SYS drivers from the DOS prompt

 -=> Quoting Larry Anderson to Bat Lang, [07 Oct 95  01:35:04] <=-

 JC> I am looking for something that will read my CONFIG.SYS and load all the
 JC> drivers, WITHOUT having to reboot my computer. Just like : LOADSYS

 LA> I think you are asking for trouble, I have found that most programs do
 LA> not remove themself from memory correctly. When I use a program that
                [... text deleted for brevity ...]

No, sir, I was not asking for trouble, I can assure you.  {^; I hope JC
read your msg, because I was also advising against this methodology, but
also referred him to a util.  Perhaps that is how you got me crossed up
with him.  {^;  Good Modeming!  /\oo/\

... NetMail at 1:382/1201, or E-mail: bat.lang@1201.ima.infomail.com
-!- Blue Wave/Max v2.12
 ! Origin: The HUB * Austin TX * Centex PCUG * 512-346-1852 (1:382/1201)


 Area: Batch Language Programming                     FI 
  Msg#: 447                                          Date: 05 Oct 95  18:12:06
  From: Larry Nelson                                 Read: Yes    Replied: No 
    To: John Davenport Scheuer                       Mark:                     
  Subj: For command

         JOHN:

 Subject: Re: For command

 JS> I have come up with an additional method that is extremely fast.  
 JS> Just have all your temp files be like temp1.fil, temp2.fil, etc.

 JS> if exist temp1.fil del temp?.fil > nul

      I won't even bother to time it. It is just obviously, right.
      There is another point to be concidered here. While one tends to
      give the most attention to body of a Batch file, the cleanup
      function often gets delt with as a less important chore. I have
      seen your tip used before but because I had a cleanup routine
      that I knew would work I didn't even consider it as a possible
      improvment on FOR. TKS for reminding me that no part of a Batch
      file is beyond creative improvment.
 :L8r
         Larry
         .......In a pinch a stone ax still works.......




-!- Maximus 2.02
 ! Origin: MSDOS MAXIMUS BBS (1:343/101)


 Area: Batch Language Programming                     FI 
  Msg#: 433             Rec'd                        Date: 10 Oct 95  08:36:08
  From: John Davenport Scheuer                       Read: Yes    Replied: No 
    To: Bat Lang                                     Mark:                     
  Subj: Edlin Manual

BL> Well, there is a void for one of you to fill.  Currently in the BFDS
BL> files we have a:
BL> 
BL> DEBUGTXT.ZIP    14k    11-01-94  DEBUG tutorial is made to present an
BL>                                  overview of the DEBUG.COM program for the 
BL>                                  PC.
BL> 
BL> But not even a nibble on EDLIN.  To get the right person started, the
BL> above might be consulted for ideas (on format, shape, content, etc.).
BL> How about it, you EDLINers??  Good Modeming!  /\oo/\

If you had caught me a few weeks earlier I would have been more inclined to 
try this, but still may.  Edlin is fine for certain things but now Roger
Scudder has put me onto sed.  Sed is a PD port of the Unix stream editor to 
DOS and it has superior search and replace capabilities to endlin, and is not 
DOS version dependent.  It was even designed to be scripted, whereas
scripting edlin is just a kludge.  However, there is not much to edlin that
is not covered in its own online help.  So a manual could be short and sweet,
there are just a few groundrules and concepts that are useful when scripting
it that I could add to that.  I'll get back to you on it if I decide to
tackle it.  Any other takers?

-!- Renegade v10-05 Exp
 ! Origin: Dar's House '13' BBS w/RIP & ANsI (610)543-1562 (1:273/433)


 Area: Batch Language Programming                     FI 
  Msg#: 434                                          Date: 17 Oct 95  20:00:18
  From: Dennis Mccunney                              Read: Yes    Replied: No 
    To: Michael Tabak                                Mark:                     
  Subj: Error Levels

 ** From Michael Tabak to All on 13 Oct 95  07:51:00
 ** Re: Error Levels

 MT> How does one determine what the various error levels from a program
 MT> are?

    Using the IF ERRORLEVEL command.  For instance, assume we are
 running program foo, and foo returns the following errorlevels:

    0   foo completed processing normally
    1   foo failed to complete processing
    2   foo couldn't find the file you ran it on
    4   foo ran out of disk space while processing
    8   foo ran out of memory while processing

 We could run foo in a batch file like this::

    foo %1
    if errorlevel 8 goto no_mem
    if errorlevel 4 goto no_disk
    if errorlevel 2 goto notfound
    if errorlevel 1 goto fail
    goto do_next
 :no_mem
    echo foo ran out of memory while processing %1
    goto end
 :no_disk
    echo foo ran out of disk space while processing %1
    goto end
 :notfound
    echo foo could not find %1 to process
    goto end
 :fail
    foo blew up attempting to process %1
    goto end
 :do_next
    <do whatever here>
 :end

    The thing to remember about IF ERRORLEVEL it that it tests whether
 the return code from the program you ran was *greater* than or equal to
 the number you supply.  Thus, errorlevel checks should be done in
 *descending* order.  "IF ERRORLEVEL 0" will *always* be true, because
 *ant errorlevel returned will be equal to or greater than zero.


-!- Blue Wave/Max v2.20 [NR]
 ! Origin: * BlueDog BBS * (212) 594-4425 * NYC FileBone Hub (1:278/304)


 Area: Batch Language Programming                     FI 
  Msg#: 435                                          Date: 22 Oct 95  19:02:00
  From: Clay Cherneff                                Read: Yes    Replied: No 
    To: Michael Nunneley                             Mark:                     
  Subj: extension

 -=> Quoting Michael Nunneley to All <=-

 MN> Hello All!

 MN> Why does this not work?
 
 MN> if %1=%1.zip goto ZIP

 Firstly, the comparison requires 2 equal signs (==).
 Secondly, you've set a comparison which will never be true:

 If you call this batch file with FILENAME for example, the comparison
 will be "if FILENAME is exactly the same, letter for letter as 
 FILENAME.ZIP, then goto ZIP".  
 FILENAME is not the same as FILENAME.ZIP 
 
 Comparisons also need something to compare when there is no %1...
 if %1!==.zip! ...or... if "%1"==".zip"    ...etc.

 Try instead:

 if exist %1.zip goto ZIP
 if exist %1.arj goto ARJ

 ...and so on, or:

 for %%x in (zip arj lha) do if exist %1.%%x goto %%x


... Backup not found: (A)bort (R)etry (P)anic  
-!- Blue Wave/SBBS v2.12 [NR]
 ! Origin: Mystic Runes 28.8 DS V.Everything [604]746-0156 (1:340/207.0)


 Area: Batch Language Programming                     FI 
  Msg#: 448                                          Date: 27 Oct 95  10:02:00
  From: Gerry Pareja                                 Read: Yes    Replied: No 
    To: Michel Castonguay                            Mark:                     
  Subj: Double space text files

MC>How can I convert a DOUBLE space text file
MC>(2 Enters at each end of line) to a SINGLE space...

MC>This is found to be annoying everytime I save text
MC>in internet with Netscape.

 If you want a _fast_ method, use Rob Flor's ALTER.EXE (which is in
 PALADIN.ZIP):

 alter myfile.txt 13,10,13,10 13,10

 If you require a plain MS-DOS "vanilla" method, this works, but is much
 slower:

 @echo off
 :: SINGLE.BAT
 if "%2"=="" goto help
 echo Creating Basic program...
 echo open "%1" for input as #1>%temp%\single.bas
 echo open "%2" for output as #2>>%temp%\single.bas
 echo while not eof(1)>>%temp%\single.bas
 echo   line input#1,a$>>%temp%\single.bas
 echo   if not len(ltrim$(a$))=0 then print #2,a$>>%temp%\single.bas
 echo wend>>%temp%\single.bas
 echo close 1:close 2>>%temp%\single.bas
 echo system>>%temp%\single.bas
 echo Running Basic...
 qbasic/run %temp%\single.bas
 del %temp%\single.bas
 goto end

 :help
 echo Syntax:
 echo %0 input.fil output.fil
 echo.
 echo This program will "single-space" the input file by filtering out
 echo any blank lines.

 :end

 Gerry


 * OLX 2.1 TD * G. Pareja * Vancouver * B.C. * Canada *

-!- Maximus 2.02
 ! Origin: VKUG/VPCC Batpower Echo - Richmond, BC (1:153/151)


 Area: Batch Language Programming                     FI 
  Msg#: 443                                          Date: 29 Oct 95  10:13:04
  From: Gerry Pareja                                 Read: Yes    Replied: No 
    To: John Medland                                 Mark:                     
  Subj: lines added w/FIND>file

JM>JM>Would anyone know how to strip the line(s) that FIND adds to its output?
JM> GP>  Sure.  Use it as a _filter_ :
JM> GP>       type filename|find "%1" >file
JM> GP>  or
JM> GP>       find "%1" < filename > file

JM>Thank you

 Welcome.  I wanted to mention that sometimes it's useful to harness
 that extraneous line which FIND outputs.  Example for doing a line
 count of a UUE script:

echo set lcount=%%2>%temp%\--------.bat
echo Counting lines...
find /v /c "BEETHOVENS NINTH" %filename%.uue > %temp%\templine.bat
call %temp%\templine.bat
echo.>>%filename%.uue
echo NOTE: Script contains %lcount% lines of text.>>%filename%.uue

 The FIND command is used here in it's "normal" mode, which will
 generate a line starting with a row of "-" and ending with a number
 which is the line count of lines which do _NOT_ contain the string
 "BEETHOVENS NINTH" (not too likely in a UUencoded script...  :-)

 The trick used to is to create a "magic" batch file named

          --------.BAT

 which contains:

           set lcount=%2

 Since FIND's output (example):

          ---------- FILENAME.UUE: 237

 is redirected to "TEMPLINE.BAT" and that is subsequently CALLED, it
 calls --------, which sets the environment variable desired.

 There you go.

 Gerry


 * OLX 2.1 TD * G. Pareja * Vancouver * B.C. * Canada *

-!- Maximus 2.02
 ! Origin: VKUG/VPCC Batpower Echo - Richmond, BC (1:153/151)


 Area: Batch Language Programming                     FI 
  Msg#: 439                                          Date: 02 Nov 95  18:51:49
  From: Joey Staton                                  Read: Yes    Replied: No 
    To: Ron Warder                                   Mark:                     
  Subj: Hide Output?

Hi Ron,

In a message of <Wed 1 Nov 95 19:42> to Gary Cassidy, you wrote:

 GC>Is there any way I can tell DOS *NOT* to display the results of various
 GC>commands in a batch file?

 RW>   Yes and no :).

How 'bout YES YES YES :?)

 RW> Yes, if the program is written to STDOUT, or standard
 RW> output.  No, if the program is written to STDERR, or standard error.
 RW> Programs written to standard output can have their normal output
 RW> suppressed by piping it to the DOS NUL device.  Programs that are written
 RW> to STDERR CAN have the normal message displays suppressed, but not by
 RW> using the NUL device.  Fortunately, as far as I know, all DOS internal
 RW> commands are written to STDOUT

Error messages from dos commands go to STDERR, not STDOUT.

 RW> , so redirecting to NUL is a cinch.

You can easily redirect STDERR (and everything else) to the NUL device.

-!- cut here --
@echo off
REM - batch file that has NO output
REM - (not even "file not found" or "1 file(s) copied")
CTTY NUL
copy c:\bbs\*.sys c:\backup
CTTY CON
-!- cut here ---

 RW> [...]
 RW> redirect the normal output to NUL, like so:
 RW>                COPY filename.ext C:\BBS\BACKUP >NUL
 RW>   The message output from this command would look be a blank line, instead
 RW> of the usual message shown in the first example.

Unless there wasn't a filename.ext in the current directory, in which case it
would plainly say

File not found - FILENAME.EXT

You can, however, use the CTTY NUL method above to redirect this output!

 GC>I wrote a little batch file that backs up my BBS files nightly.  I am now
 GC>playing with it both to learn and mostly just to "Pretty" it up a bit.  I
 GC>drew a couple of ANSI screens that display what is actually happening
 GC>
 GC>               "Now copying c:\bbs\*.sys c:\backup"
 GC>
 GC>My problem is that DOS keeps on displaying the results of the copy!  I use
 GC>the "@ECHO OFF" at the beginning of the batch file but of course this only
 GC>hides the commands, not the results.  Any thoughts/tips you could suggest
 GC>for me?

 RW>   Rewrite the command that goes with the above ANSI message to read
 RW> thusly:
 RW>                Copy c:\bbs\*.sys c:\backup >NUL
 RW>   Voila!  Now all you should see is your fancy ANSI. :)

Again, unless copy has something to say to STDERR, which it frequently does, in
which case "File not found" or some such will apprear uninvited over the pretty
ANSI screen.

 RW>   Hope this gives you some ideas to build on. Let us know if you need any
 RW> help redirecting any messages returned by programs written to STDERR, it's
 RW> a very interesting subject ....

Hope my info has been helpful.  Please let me know if it's not helpful, or if
you find something to be in error!  Thanks.

Bye, Joey.

-!-
 ! Origin: Guardian Angel Dust In the Wind Cries Mary (1:3651/13.13@fidonet)


 Area: Batch Language Programming                     FI 
  Msg#: 446                                          Date: 03 Nov 95  10:26:08
  From: John Davenport Scheuer                       Read: Yes    Replied: No 
    To: Gary Cooper                                  Mark:                     
  Subj: Re: Edlindoc.zip 1/3

GC> I believe all the relevant Edlin material was in previous MUF lists,
GC> the question is, did JDS know that a MUF list existed?

Mmmm, nothing on it in the muf15 I have.  Furlan just sent me the muf17 and 
all that has that I would have included (and will include in an update/patch 
for edlin.doc) is the undocumented line commands.  These are actually quite
helpful additions regardless of whether edlin is used in scripted or in 
command mode.  For the curious these are:

#          for end of file (the line after the last line of the file).
-1 or -n   for one line back or n line(s) back from the current line.
+1 or +n   for one line ahead or n line(s) ahead of the current line.

These expressions may be used in almost all places where edlin will ordinarily
accept a plain number as denoting a line, ie: [line1],[line2] situations.  
There are limitations but they arise from the logic edlin uses to determine 
the current line, for example:

#,-1d

One might think that would delete the last line of the file, but in this case,
-1 is determined from whatever the current line is when this command is 
issued.  But you can still get at the last line of a file using these 
commands like so:

#[ENTER][ENTER]-1d[ENTER]

Where the [ENTER] represents pressing the enter key.

-!- Renegade v10-05 Exp
 ! Origin: Dar's House '13' BBS w/RIP & ANsI (610)543-1562 (1:273/433)


 Area: Batch Language Programming                     FI 
  Msg#: 449                                          Date: 05 Nov 95  17:33:36
  From: Joe Kron                                     Read: Yes    Replied: No 
    To: Jim Danvers                                  Mark:                     
  Subj: Error Levels

Ok. Here goes...

@echo off
rem ERRVAR.BAT to convert an ERRORLEVEL to an environment variable
rem from PC Mag. 1-30-90 & IBID 2-13-90 as revised J. Kron
set E=
for %%Q in (0 1 2) do if errorlevel %%Q00 set E=%%Q
if not "%E%"=="2" set LIST=6 7 8 9
for %%Q in (0 1 2 3 4 5 %LIST%) do if errorlevel %E%%%Q0 set E=%E%%%Q
set LIST=
if not "%E%"=="25" set LIST=6 7 8 9
for %%Q in (0 1 2 3 4 5 %LIST%) do if errorlevel %E%%%Q set E=%E%%%Q
set LIST=

I don't know about FREQing except that the sysop was able to get me something
that I wanted that way. What does it really mean?

-!- Maximus 3.00
 ! Origin: The 12th Step BBS <203>852-1986 Norwalk,CT (1:141/252)


 Area: Batch Language Programming                     FI 
  Msg#: 440                                          Date: 04 Nov 95  10:50:03
  From: John Davenport Scheuer                       Read: Yes    Replied: No 
    To: Larry Nelson                                 Mark:                     
  Subj: Re: Help!

LN>       A simple routine for determining the number of lines in a
LN>       given text file is......
LN> 
LN>          type (path to filename.ext) |find/v/c "!!!!!!!!"
LN> 
LN>       This routine filters a file and counts all lines not holding
LN>       the string !!!!!!!!. AS the string !!!!!!!! does not come up
LN>       all that often the chances are that you will get a good count.

I've seen it done using "BEETHOVANSNINTH" and various others but found that 
just "" works just fine.  I even responded to this earlier with a litte 
edlin/batch solution which incorporates this use of find, but, it turns out 
edlin doesn't even need to know how many lines are in a file to find the end, 
so this would also work:

_______ TRIMADD.BAT ________
@echo off
if not exist %1 goto error
echo # > edlin.scr
echo -1d >> edlin.scr
echo e >> edlin.scr
edlin %1 < edlin.scr > nul
echo Whatever you want to add as the new last line >> %1
del edlin.scr > nul
goto end
:error
echo.
echo ERROR! Could not find %1!
echo.
:end
___________

Syntax is:

Trimadd [drive:\][path\]filename.ext

Where filename.ext is the file to be acted upon.  You may replace the text:

"Whatever you want to add as the new last line"

In the above batch file to make it be what you want it to be.

-!- Renegade v10-05 Exp
 ! Origin: Dar's House '13' BBS w/RIP & ANsI (610)543-1562 (1:273/433)


 Area: Batch Language Programming                     FI 
  Msg#: 420                                          Date: 04 Nov 95  18:48:43
  From: Joey Staton                                  Read: Yes    Replied: No 
    To: Michael Ayres                                Mark:                     
  Subj: Hide Output?

Hi Michael, (and other helpful posters)

In a message of <Thu 2 Nov 95 13:51> to Gary Cassidy (1:243/82@fidonet), you
wrote:

 GC>                "Now copying c:\bbs\*.sys c:\backup"

 MA>   copy c:\bbs\*.sys c:\backup >nul
 MA>                               ^^^^
 MA>   That will keep the output from showing on the screen, but the copy will
 MA> still take place.

I have seen maybe 10 or 15 of this same response.  Only one problem with that,

IT DOESN'T WORK!!
~~ ~~~~~~~ ~~~~~~

I repeat:  COPY [whatever] [wherever] >NUL

DOES    NOT    SUPPRESS   THE   OUTPUT!
~~~~    ~~~    ~~~~~~~~   ~~~   ~~~~~~~

It still will cheerfully spew things across the screen if you use >nul.

USE CTTY NUL.  THIS WILL SUPPRESS ALL OUTPUT FROM THE COPY COMMAND!

Just so there's no confusion, I'll go over it again!

The following line appears to be written so as to not produce screen output:

copy filename.ext c:\ >nul

-- but -- try it now.  Go ahead!  Shell to dos and type the above line exactly
as it appears.

No; I don't mean think about it.  You may already think it works; I mean SHELL
OUT TO DOS and type the command.  What you think may be very different from
what DOS does.

Back yet?  It said:

File not found - FILENAME.EXT

In other words, the output is not suppressed.

To suppress the output, use the following batch file:

-!- cut here ---
@echo off
ctty nul
copy filename.ext c:\
ctty con
-!- cut here ---

Now go try this one.  Back yet?  That's right, no output!

Hope this helps.

Bye, Joey.

-!-
 ! Origin: Guardian Angel Dust In the Wind Cries Mary (1:3651/13.13@fidonet)


 Area: Batch Language Programming                     FI 
  Msg#: 427                                          Date: 08 Nov 95  07:00:01
  From: Tom Creek                                    Read: Yes    Replied: No 
    To: Gary Smith                                   Mark:                     
  Subj: FTP Site for BFDS Files

Hello Gary!

06 Nov 95 02:00, Gary Smith wrote to Bat Lang:

 BL>  GS>> Perhaps you could post a "still needed" list on the FTP site?
 >>  GS> I'm sure you'd rather get each file only once, and that way
 >>  GS> we could check before mailing.

 BL>> Hey, that's too logical for the rest of us.  {^;  Good Modeming!
 BL>> /\oo/\

 GS> Sort of, but not precisely, on the same topic:  I was able to
 GS> connect to the FTP site (ftp.imagi.net) shortly after Tom
 GS> announced it, but I've never been able to connect since.
 GS> Evidently it's not yet ready for prime time.

Without much prior announcement, they moved it (physically moved it) one
weekend. To make matters worse, the IP number changed, and the circuit is only
56K at the new site. The circuit is being updated, and the ip number is
204.119.24.13. Try connecting with the IP number instead of the name.  The
circuit upgrade should be finished in a couple of weeks, so bear with the slow
connections till then. Best not to try it during the "prime time hour" of
1700-2300 Alaska Standard Time. That is when the connection crawl.

Regards,
       Tom Creek
       Internet: tcsbbs@imagi.net

... What's 20,000 lawyers rotting in a swamp? A GOOD START!
-!- GoldED/386 2.50+
 ! Origin: T.C.'s Byte Bank System|North Pole AK| (1:355/2)


 Area: Batch Language Programming                     FI 
  Msg#: 436                                          Date: 07 Nov 95  10:34:00
  From: Horst Schaeffer                              Read: Yes    Replied: No 
    To: Scott Farrell                                Mark:                     
  Subj: Loop Counter

-=> quoting Scott Farrell to All (4 Nov 95) <=-

SF> I'm _sure_ there is an easy way to do this - just can't think of
SF> it right now <G>.  How would I go about creating a loop counter in
SF> a vanilla batch file.  I've tried a statement along the lines of
SF> SET %COUNT=%COUNT+1 - unfortunately this didn't seem to work!?

For small counts the "string method" will do (example: count to 5)

    set COUNT=
    :LOOP
    :: (** do anything here **)
    set COUNT=%COUNT%x
    if not %COUNT%==xxxxx goto LOOP
    set COUNT=

For larger counts (or if you need the digits for some reason)
here is a solution that takes a variable for each digit.

This example uses the 3 digits: U (units), T (tens) and H (hundreds),
so the count would be: %H%%T%%U%
                                                (comments)
    for %%a in (H T U) do set %%a=0             (reset count)
    :LOOP
    echo set U=%%%U%>1.BAT                      (write to 1.BAT)
    if %U%==9 echo set T=%%%T%>>1.BAT           (overflow handling)
    if %T%%U%==99 echo set H=%%%H%>>1.BAT
    call 1 2 3 4 5 6 7 8 9 0                    (calling 1.BAT)
    :: (** do anything using %H%%T%%U% **)
    if not %H%%T%%U%==%MAX% goto LOOP           (count to %MAX%)
    ::
    for %%a in (H T U) do set %%a=              (clear)
    del 1.BAT

The routine writes SET statements into the temporary file 1.BAT
(in the current directory). For example if U=0, the line: SET U=%0
will be written (the first two %'s reduce to a single %, and %U% is 0).
Now, when the CALL is executed, %0 becomes 1 (%1 wold become 2 etc.)

Horst.

... Q4FM 2.10 ... horst@confusion.muc.nacamar.de

-!- FM 2.02 / ScanToss
 ! Origin: HS.MUC Germany (2:2480/13.75)


 Area: Batch Language Programming                     FI 
  Msg#: 408                                          Date: 14 Nov 95  17:57:24
  From: Larry Nelson                                 Read: Yes    Replied: No 
    To: John Blackmer                                Mark:                     
  Subj: Volume Label

         JOHN:

 Subject: volume label

 JB> I have been trying to figure out just how to read, in particular,
 JB> the volume label of a disk in drive a and put it in an environment
 JB> variable.

      This has worked for me. It should give you the lable of any
      drive: you pass it as a parameter.
      
   ::LLABEL.BAT
   @echo off
   cls
         if %1! == ! goto hlp
         dir/-p %1 |find "Volume in" >!!!1.bat
      echo set lab=%%5 >volume.bat
         call !!!1
      echo The current drive label is %lab%
         for %%q in (!!!1 volume) do del %%q.bat
         set lab=
      goto L8r
   :hlp
      echo SYNTAX = llabel (drive:)
   :L8r


 JB> In general, I'd like to be able to do the same or something similar
 JB> with other parts of a directory listing. I guess what I'm really
 JB> asking is how to pick and choose sections of a text file (re-directed
 JB> directory) and place the selected sections in variables for use in
 JB> multiple batch files.

      Llabel.bat demonstrates the function you are asking about.
      The working part.....

         dir/-p %1 |find "Volume in" >!!!1.bat
      echo set lab=%%5 >volume.bat
         call !!!1

      is called a Magic.bat and as you see it filters the
      directory listing of a given drive: through Find using the
      Pipe function. Find is asked to look for all lines holding
      the string/s within the quotes. In this case "Volume in".
      That line, which just happens to come up as part of the header
      in every directory listing, is then redirected to a Batch
      file named !!!1.bat. This name is arbitrary the next name
      is not however, as you will see.....
      
    Volume in drive A is MAIL       
    Volume Serial Number is 325C-1DD6
    Directory of A:\

   SYSDAT4              1,894 07-07-95  10:26p
   BATPOWER             1,852 07-12-95  12:28a
   SYSDAT3              1,011 04-11-95   7:43p
   FIND1                1,039 04-11-95   9:47p
   MNU2                 4,145 09-07-95   3:20p

      We now have a .bat named !!!1.bat that holds a single line....

    Volume in drive A is MAIL

      The second line of the magic trio says....

      echo set lab=%%5 >volume.bat

      It's no coinsidence that the .bat reciveing this new line
      (set lab=%%5) is named "volume". In this case Volume is
      the first string in the line that we sent to !!!1.bat
      and is our "handle" for this routine.
      The next line in the trio calls !!!1.bat. Because DOS knows
      that a user would never lie to his computer, and because
      a Batch file exists named Volume, DOS assumes that we want to
      call Volume.bat and respond to the command therein.
      Presto! one envar named "LAB" now holds the string that
      was the 5th parameter to the command "Volume". In this case "MAIL".

               Volume in drive A is MAIL
               |      |  |     | |  |_pram5
               |      |  |     | |_pram4
               |      |  |     |_pram3
               |      |  |_pram2
               |      |_pram1
               |_Volume.bat

      This routine works any time a bit of data that you want to
      use is lead by a handle. There are ways to create a handle
      when none are available, but that will need more time
      and space.
      I hope this has covered some of your requests.
 :L8r
         Larry
         ......In a pinch a stone ax still works......
     

-!- Maximus 2.02
 ! Origin: MSDOS MAXIMUS BBS (1:343/101)


 Area: Batch Language Programming                     FI 
  Msg#: 444                                          Date: 16 Nov 95  01:07:14
  From: Dennis Mccunney                              Read: Yes    Replied: No 
    To: furlan primus                                Mark:                     
  Subj: Helpful bat

 ** From furlan primus to Gary Smith on 09 Nov 95  18:28:48
 ** Re: Helpful bat

 fp> it probably works under 4DOS (i can't test it at the moment as i don't
 fp> have  Windows on the drive at the moment) and is pointless as 4DOS has
 fp> a variable  that tells you if Windows is loaded.  wasn't there a trick
 fp> w/ the PATH to  uppercase an environment variable for subsequent
 fp> testing?  i seem to recall  seeing something like that here at one
 fp> time, perhaps one of Vernon's clever  workarounds?

    There is such a trick: the PATH command converts anything fed to it
 to uppercase, so one can use:

    set OLDPATH=%PATH%
    path %1
    set foo=%PATH%
    set path=%OLDPATH%
    echo %FOO%

 and whatever you fed it as %1 will be converted to uppercase and
 assigned as the value of the variable foo.

    But this only helps you to make a *value* uppercase: it doesn't do
 much good if the variable *name* is what you need to look for.







-!- Blue Wave/Max v2.20 [NR]
 ! Origin: * BlueDog BBS * (212) 594-4425 * NYC FileBone Hub (1:278/304)


 Area: Batch Language Programming                     FI 
  Msg#: 445                                          Date: 18 Nov 95  00:39:16
  From: Larry Nelson                                 Read: Yes    Replied: No 
    To: Graham Pearson                               Mark:                     
  Subj: Wait command?

         GRAHAM:

 Subject: WAIT COMMAND ?

Hello All:

        Is there a way to create a batch file that will wait a number of
        seconds or minutes before it will continue? I need something for my
        node 1 machine that will wait for a number of minutes before it
        continues. So it gives the Main machine enough time to load up the
        network.

    @choice /c:<- /n /t:<-,10 <CLOCK$

      A guy named Steve Reid used to hang out here a lot. Haven't
      heard from him for some time but this is one of the things
      he left to remember him by. The timer in Choice will hang up
      if any but the specified characters are pressed while Choice
      has the program on hold. Steve found that redirecting CLOCK$
      into the mix would stop any unwanted keyboard input. I have
      no idea how this works but it do. The <- represents the ESC
      symboles and they need to be replaced with Alt-27. The 10 is
      the number of seconds to hold. Max is 99.
 :L8r
         Larry
         ......In a pinch a stone ax still works......



-!- Maximus 2.02
 ! Origin: MSDOS MAXIMUS BBS (1:343/101)


 Area: Batch Language Programming                     FI 
  Msg#: 436                                          Date: 20 Nov 95  20:10:54
  From: Andrew Kennedy                               Read: Yes    Replied: No 
    To: James Hill                                   Mark:                     
  Subj: Helpful bat

 JH> Wouldn't it be easier to do this"

 JH> mem /c|find /i "win"|if not errorlevel 1 echo Windows is running.

It worker like a charm.

-!- Maximus/2 3.00
 ! Origin: COMM Port OS/2 (713) 980-9671 (1:106/2000)


 Area: Batch Language Programming                     FI 
  Msg#: 443                                          Date: 22 Nov 95  10:50:02
  From: William Lipp                                 Read: Yes    Replied: No 
    To: Roger Scudder                                Mark:                     
  Subj: Re: help

 -=> Quoting Roger Scudder to William Lipp to Daniel Nijs
 
 WL>         @ECHO OFF
 WL>         if (%1) == (ONEFILE) goto ONEFILE
 WL>         CLS
 WL>         Echo Looking For Files ...
 WL>         for %%f in (%3) do call %0 ONEFILE %1 %2 %%f %4 %5 %6 %7 %8 %9
 WL>         goto END

 RS> Nice use of recursion!
 
Thanks.  I've found this approach of recursion with a flag to be a powerful
idea in batch programming.
 
___ Blue Wave/QWK v2.12

-!- Maximus 3.00
 ! Origin: this space available bbs! 1-203-759-5825 (1:141/1111)


 Area: Batch Language Programming                     FI 
  Msg#: 447                                          Date: 21 Nov 95  20:13:34
  From: Larry Nelson                                 Read: Yes    Replied: No 
    To: All                                          Mark:                     
  Subj: count.bat

         ALL:

      One of the hassels that go along with The Magic named .bat
      is the situation where the piece of data that you want
      to place in a DOS environment variable comes without a
      handle. One example is the available disk value....

                    325,632 bytes free

      That's all there is. Nothing leading the number to use
      as the name for the named .bat. Another example is shown
      in the Batch file below. Count.bat uses Find to get a
      count of lines in a given file. In this case the data
      we are looking for is a created number and it shows up
      in the temp file as.....

                     15

      Again bare data with nothing to use as a handle. Count
      however has a way create a handle with help from FC.

 ::COUNT.BAT
 @echo off
 cls
      If %1! == ! goto hlp
      type %1|find/v/c "">enter.bat
               :: If %1 had been Count.bat the value in Enter.bat
               :: would be  15.

      fc enter.bat nul /lb1 /n|date|find " 1: ">enter2.bat
               :: FC loads the line in Enter.bat into it's buffer
               :: then pipes that data plus data picked up from
               :: DATE through Find searching for " 1: ". The
               :: whole mess ends up in enter2.bat looking like.....
               ::
               ::    Enter new date (mm-dd-yy):     1:  15
               
   echo set count=%%5>enter.bat
               :: Enter.bat is over written with the line....
               ::
               ::       set count=%5

      call enter2.bat
               :: Enter2.bat is called which in turn calls Enter.bat
               :: with the parameters of.....
               ::
               ::    new date (mm-dd-yy):     1:  15
               ::
               :: The fifth of which is  15, and presto!, a bit of
               :: data with no handle has become an environment variable.

      del enter*.bat
   echo %count%
      set count=
   goto L8r
 :hlp
   echo SYNTAX = count (filename.ext)
 :L8r

      Here it is without natation.

 ::COUNT.BAT
 @echo off
 cls
      If %1! == ! goto hlp
      type %1|find/v/c "">enter.bat
      fc enter.bat nul /lb1 /n|date|find " 1: ">enter2.bat
   echo set count=%%5>enter.bat
      call enter2.bat
      del enter*.bat
   echo %count%
      set count=
   goto L8r
 :hlp
   echo SYNTAX = count (filename.ext)
 :L8r


-!- Maximus 2.02
 ! Origin: MSDOS MAXIMUS BBS (1:343/101)


 Area: Batch Language Programming                     FI 
  Msg#: 435                                          Date: 20 Nov 95  18:32:02
  From: John McLachlan                               Read: Yes    Replied: No 
    To: Graham Pearson                               Mark:                     
  Subj: Wait Command ?

 On 11-15-95 Graham Pearson wrote to All... 
 
 GP> Hello All: 
 GP> 
 GP>         Is there a way to create a batch file that will wait a number 
 GP> of seconds or minutes before it will continue? I need something 
 GP> for my node 1 machine that will wait for a number of minutes be 
 GP> fore it continues. 
 
 GP> Graham Pearson, Sysop 
 GP> Fifth Dimention above Heaven 
 GP> 
G'day Graham 
  I use  delay.bat 
 
@echo off 
choice /c:1 /t:1,%1<clock$>nul 
rem  where %1 is the number of seconds delay requested 
 
 
          |\_/| 
          | c |  John McLachlan 
        +-+   +--    Brisbane, Qld, Australia 
___ 
 * OFFLINE 1.58 * ... As long as I can remember, I've had amnesia! 

-!- Maximus/2 3.00
 ! Origin: madHouse Inc (3:640/820)


 Area: Batch Language Programming                     FI 
  Msg#: 445                                          Date: 25 Nov 95  19:31:00
  From: William Lipp                                 Read: Yes    Replied: No 
    To: David Roitman                                Mark:                     
  Subj: Re: How do you read file

 -=> Quoting David Roitman to All <=-

 DR> I would like to read the file date from a file.  I've been 
 DR> using a simply batch file to view the last time the 
 DR> computer was booted or rebooted.  I just echo some rubbish 
 DR> to a BAT file and that BAT file has the date and time I'm 
 DR> keen on seeing.  Is their a way I can use BATCH language to 
 DR> read the time and date of the file and display it on the 
 DR> screen with some text to indicate to myself and others when 
 DR> the last time the computer was rebooted?

Lots of ways to this.  If the above is a complete description of your
wishes, I'd scrap the semaphore file and capture the time and date into
an environment variable at startup using the "magic named batch file"
Current.bat.  

People in this echo often explain five ways of using day and time
information in a batch file: simple redirection of the date and time
command,  "find" filter on the date command, magic named batch file
"Current.bat," NewFile/Dir/Find/MagicName method, and redirection of
the prompt. Your problem is a prime candidate for the third method.

The following lines will put the day name and date into
environment variables "DAY" and "DATE."

    echo. | date      > TempDate.bat
    echo set DAY=%%3  >  Current.bat
    echo set DATE=%%4 >> Current.bat
    call TempDate.bat

The first line makes the file TempDate.bat that looks like this:

    Current date is Fri 09-30-1994
    Enter new date (mm-dd-yy): 

When this is executed as a batch file, it transfers control to a batch file
with the magic name Current.bat.  The magic named batch file "Current.bat"
starts with the command line arguments:

     %1 = date
     %2 = is
     %3 = Fri
     %4 = 09-30-1994

The next two lines create Current.bat, which uses these command line 
arguments to set environment variables.

The second line of TempDate.bat is never reached because control is passed
directly to Current.bat, not via "call."  You may want to put the files
on a RAM disk, and/or erase them when finished.

Time works the same way - the output of the time command also begins
with "Current", so a similar batch file with the magic name "Current.bat"
can capture the time to an environment variable.

(method 3 revised 3 Nov 94.  Posted 10 times.  Last posted 29 July 95)

 
___ Blue Wave/QWK v2.12

-!- Maximus 3.00
 ! Origin: this space available bbs! 1-203-759-5825 (1:141/1111)


 Area: Batch Language Programming                     FI 
  Msg#: 421                                          Date: 26 Nov 95  21:43:02
  From: William Lipp                                 Read: Yes    Replied: No 
    To: Al Frey                                      Mark:                     
  Subj: Re: String Input

 -=> Quoting Al Frey to Gerry Pareja <=-

 GP> Try it this way:
 
 GP> ::::::::::::::::::::::::::::::::::::::::::::::
 GP> @echo off
 GP> echo @prompt echo ???//%%%%5 $G text.fed>$.bat
 GP> %comspec% /c$.bat>enter.bat
 GP> ::::::::::::::::::::::::::::::::::::::::::::::
 
 GP> Now if we type enter.bat, we see:
 
 GP> echo ???//%5 > text.fed
 GP> ::::::::::::::::::::::::::::::::::::::::::::::::
 
 GP> The "trick" is that "$G" inside of a PROMPT statement gets converted
 GP>to  that pesky ">" symbol you needed.  Clever, huh?  I learned it
 GP>here,  natch :-)

 AF> Clever my foot, If this works, it's outraegous! I like it.

I see it's been a while since I last posted this summary of how
to do this.  I learned it from Gerry, who learned it before I
arrived here:

Gerry Pareja, one of the resident gurus here, taught me how to redirect
the command prompt to accomplish tricks in batch files.  You can customize
your command prompt to include information about the current drive,
directory, time, date, ">", "<", "|", "=", etc.  The idea is to create
a "magic prompt" that reads like a batch file, then get it into a batch
file.  And it doesn't even change your "real" prompt!  It takes three steps.

STEP 1:

   echo @prompt PromptString > temp1.bat

      Now temp1.bat has one line, a prompt command.  Pick the 
      PromptString to write the "magic prompt" that you need.  Some 
      examples and the prompt they create are:

      @prompt $n:$_CD $p            D:
                                    CD D:\BBS\BWAVE

      @prompt SET CURR$Q$p          SET CURR=D:\BBS\BWAVE

      You might want to issue these prompt commands interactively 
      (without @) to better understand how this works.

STEP 2:

   %COMSPEC% /C temp1.bat > temp2.bat

      Now temp2.bat has 2 or more lines.  The first line is blank.
      The other lines contain the magic prompt we composed in step one.
      We have turned the prompt into a real batch file!

STEP 3:

   call temp2.bat

      This uses the batch file.

Notes:
   For a complete implementation you may want to erase the work files.
   For speed you might put the work files onto a RAM disk.  For some
   purposes you might want to insert additional work between steps two
   and three.  If those additional steps change the current directory,
   then you need to know where "temp2.bat" was created - perhaps as
   %TEMP%\temp2.bat.

(Revised 26 Nov 1995.  Posted 7 times.  Last posted 15 May 1995)
 
___ Blue Wave/QWK v2.12

-!- Maximus 3.00
 ! Origin: this space available bbs! 1-203-759-5825 (1:141/1111)


 Area: Batch Language Programming                     FI 
  Msg#: 447             Rec'd                        Date: 28 Nov 95  11:20:00
  From: Michael Laprade                              Read: Yes    Replied: No 
    To: Bat Lang                                     Mark:                     
  Subj: Scancode.Scr

Could you please tell me if this code was mistyped?  Got this from
this echo and have tried it on my system w/ DOS 6.22 but, it doesnt
return the scan code.  I have the scan code tables but, this program
certainly would be useful.  Thnx.

N SCANCODE.COM
E100 32 E4 CD 16 80 FC 0 74 F7 8A C4 50 50 BB 80 0 43 80 3F 3F 74 7 80
E117 3F D 74 30 75 F3 BA 54 1 E8 2C 0 58 32 E4 BB A 0 B9 3 0 33 D2 F7
E12F F3 83 C2 30 52 E2 F6 B9 3 0 B4 2 5A CD 21 E2 FB BA D8 1 E8 9 0 58
E147 3C 1 75 B5 B4 4C CD 21 B4 9 CD 21 C3 54 68 65 20 6B 65 79 62 6F 61
E15E 72 64 20 73 63 61 6E 20 63 6F 64 65 20 66 6F 72 20 74 68 65 20 6B
E174 65 79 20 70 72 65 73 73 65 64 20 69 73 20 24 D A 20 52 65 74 75 72
E18B 6E 73 20 6B 65 79 62 6F 61 72 64 20 73 63 61 6E 20 63 6F 64 65 20
E1A1 61 73 20 61 6E 20 65 72 72 6F 72 6C 65 76 65 6C 20 2D 20 44 61 76
E1CE 69 64 20 41 64 61 6D 73 6F 6E D A 24
RCX
DB
W
Q

-!- RBBSMail/386 v0.997
 ! Origin: (713) 664-0002 Lightspeed Systems - 24hrs (1:106/7.0)


 Area: Batch Language Programming                     FI 
  Msg#: 427                                          Date: 22 Nov 95  18:40:32
  From: Greg Hills                                   Read: Yes    Replied: No 
    To: Clay Cherneff                                Mark:                     
  Subj: Loop Counter

Re: your message to Scott Farrell ...

 CC>  :loop
 CC>  if %count%!==xxxxx! goto end
 CC>  echo %count%
 CC>  count=x%count%
 CC>  goto loop

 CC>  :end
 CC>  echo The loop cycled 5 times (count the x's in %count%)
 CC>  set count=

 CC>  That's about the best way I know how to do it in batch, so the
 CC>  problem is that you don't actually get a numeric count...

ObNote: `count=x%count%' doesn't work in plain MS-DOS, but `set count=x%count%'
does.  I thank you for the hint; it has resolved a longstanding nark of mine
for doing several counted/timed tasks without reference to an external prog
such as Choice!  :)


-- Gregh (Greg Hills)

-!- GoldED 2.41+
 ! Origin: Madness takes its toll. +61-3-9429-8510 (3:634/392.23)


 Area: Batch Language Programming                     FI 
  Msg#: 434                                          Date: 30 Nov 95  02:43:07
  From: Vernon Frazee                                Read: Yes    Replied: No 
    To: Horst Schaeffer                              Mark:                     
  Subj: lower-case PATH? How?

HS> I just changed the path statement to lower case in my AUTOEXEC.BAT
HS> and rebooted. No chance. SET always shows it upper case. What am I
HS> doing wrong?

    If you use the syntax:

      path=c:\whatever;...     -or-     PATH=C:\WHATEVER;...     -or-
      path c:\whatever;...     -or-     PATH C:\WHATEVER;...

    DOS will store the path in all UPPER-case.

    If you'd like your PATH to remain as you have it written (lower-,
    UPPER-, or MiXeD-case), use the syntax:

      set path=c:\whatever;...

    Tip: You can type "PATH" (not the quotes) at the DOS prompt to view
         the current PATH.

    Vernon.Frazee@f71.n135.z1.fidonet.org

 -- SPEED 1.40 #1680:

-!-
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)


 Area: Batch Language Programming                     FI 
  Msg#: 450                                          Date: 01 Dec 95  14:16:26
  From: Robert GiLbert                               Read: Yes    Replied: No 
    To: Vernon Frazee                                Mark:                     
  Subj: 0-byte files          1/2

 VF>           chkdsk|find "bytes"|find "a"|find "n"
I didn't realize you could nest FIND statements!  Thanks VF!

ttyl8r

robert.gilbert@sasknet.sk.ca

-!- Maximus/2 3.00
 ! Origin: Community BBS * Saskatoon, SK * 306-652-2487  (1:140/191)


 Area: Batch Language Programming                     FI 
  Msg#: 426                                          Date: 01 Dec 95  14:26:05
  From: Vernon Frazee                                Read: Yes    Replied: No 
    To: Gary Cooper                                  Mark:                     
  Subj: PRTSCR during BATch

GC> PRTSCRN will work fine, IF the operation could access the batch.
GC> What David is referring to, is a screen which appears in the middle
GC> of his tape backup software's operation...  How will PRTSCRN
GC> activate while TAPE BACKUP is in mid operation?

    The example BATch file below clears the screen, does a DIR/W, and
    then ... prints the screen:

      @echo off
      cls
      dir /w
      echo xxx>prtscr.com
      prtscr
      del prtscr.com

    Important: Replace the three "xxx" characters (on the line beginning
    with "echo") with the following three keystroke sequences:

      [Alt-205][Alt-5][Alt-195]

    (hex CD, 05, and C3).  The three characters produced are the
    horizontal double-line (looks like an equal sign), the Club (as in
    cards), and what looks like a "T" laying on it's left side.

    (If you think the little PRTSCR.COM program produced might come in
    handy somewhere else down the line, simply delete the last line
    above and stick PRTSCR.COM in your UTIL (or whatever) directory).

    Here's PRTSCR.COM in DEBUG.SCR form:

      NPRTSCR.COM
      A100
      INT 05
      RET

      RCX
      3
      W
      Q

    (The 5th line must be left blank).

    Vernon.Frazee@f71.n135.z1.fidonet.org

 -- SPEED 1.40 #1680:

-!-
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)


 Area: Batch Language Programming                     FI 
  Msg#: 432                                          Date: 01 Dec 95  14:26:11
  From: Vernon Frazee                                Read: Yes    Replied: No 
    To: Joe Kron                                     Mark:                     
  Subj: User input to file

JK> If you have access to a good library, find Compute 11-'92 pg. 56 for
JK> a utility called GETLINE that will enter user input to a file.

    Here's an example of how to use a BATch file to get a users input
    and store it in an environment variable:

      @echo off
      :INPUT.BAT puts what is typed into environment variable INPUT
       set input=
       echo INPUT.BAT
       echo Type in something and press [Enter]
       fc con nul /lb1 /n|date|find "    1:  ">temptemp.bat
       echo :Loop>>enter.bat
       echo if not (%%input%%)==() set input=%%input%% %%5>>enter.bat
       echo if (%%input%%)==() set input=%%5>>enter.bat
       echo shift>>enter.bat
       echo if not (%%5)==() goto Loop>>enter.bat
       for %%x in (call del) do %%x temptemp.bat
       del enter.bat
       echo The string you just entered:
       echo %input%
       echo has been stored in an environment variable named INPUT
      :End

    Vernon.Frazee@f71.n135.z1.fidonet.org

 -- SPEED 1.40 #1680:

-!-
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)


 Area: Batch Language Programming                     FI 
  Msg#: 421                                          Date: 01 Dec 95  14:26:00
  From: Vernon Frazee                                Read: Yes    Replied: No 
    To: Gary Smith                                   Mark:                     
  Subj: Vol

GS> The reason for this is that !!!1.bat simply transfers control to
GS> volume.bat rather than calling it, so nothing after the first line
GS> of !!!1.bat will ever be executed.

LN> Another nice peice of line shaving. The snag I was talking about
LN> shows up when the data you are trapping to an envar comes in a line
LN> other than the first. Other than the Find process, I haven't found
LN> any way to get at it.

GS> Yep, in that case FIND is still the only solution.

    Don't forget DOS's SORT command.  For example, let's say the
    command:

      VOL A:

    returns the following info:

       Volume in drive A is BATPOWER
       Volume Serial Number is 1249-14FC

    (note: each line above begins with a single space), and we want to
    put the Serial Number, from the second line, in an environment
    variable named SN:

      @echo off
      vol %1>tmptmp.bat
      type tmptmp.bat|sort /+10>tmptmp.bat
      echo set sn=%%4>volume.bat
      call tmptmp.bat
      if (%sn%)==(is) set sn=None
      echo %sn%
      for %%x in (tmptmp volume) do del %%x.bat
    
    The 3rd line:

      type tmptmp.bat|sort /+10>tmptmp.bat

    sorts the data in the TMPTMP.BAT file on the 10th character:

       Volume in drive A is BATPOWER
       Volume Serial Number is 1249-14FC
      |||||||||^
      1234567890

    ("e" comes before "n") which flips the lines like so:

       Volume Serial Number is 1249-14FC
       Volume in drive A is BATPOWER

    Now it's a simple matter to grab the 4th parameter off the 1st line.

    The reason for the 6th line:

      if (%sn%)==(is) set sn=None
    
    is to catch the disks that don't have a Serial Number -- like a
    RAMDRIVE or a disk formatted with early versions of DOS.  When you
    do a "VOL" against them all they return is a single line like:

       Volume in drive A is BATPOWER

    Of course the SORT command doesn't effect this data so the 4th
    parameter ends up being the word "is".

    Anyway you get the idea. <g>  It may be possible to use the SORT
    command in those rare instances where FIND is missing.

    Vernon.Frazee@f71.n135.z1.fidonet.org

 -- SPEED 1.40 #1680:

-!-
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)


 Area: Batch Language Programming                     FI 
  Msg#: 434                                          Date: 02 Dec 95  02:19:00
  From: Vernon Frazee                                Read: Yes    Replied: No 
    To: Scott Farrell                                Mark:                     
  Subj: Loop Counter

SF> I'm _sure_ there is an easy way to do this - just can't think of it
SF> right now <G>.  How would I go about creating a loop counter in a
SF> vanilla batch file.  I've tried a statement along the lines of SET
SF> %COUNT=%COUNT+1 - unfortunately this didn't seem to work!?

    Following is one DOS BATch file example of how to use FIND to
    increment a count each time through a Loop:

      @echo off
      :EXAMPLE.BAT - One way to increment a count
      :              every time through a Loop
      :
      :Make sure everything is set to 0
       set COUNT=0
       rem>temptemp.dat
      :Loop
        :The command(s) to be executed are next
         echo.
         echo Pretending to do whatever here ...
         echo.
        :Increment the count by 1
         echo !>>temptemp.dat
         find "!" /c temptemp.dat>temptemp.bat
         echo set COUNT=%%2>--------.bat
         call temptemp.bat
        :Display the count
         echo and the count is currently at %COUNT%
         echo.
        :Does the user want to do it again?
         choice /c:yn /n "Do it again? (Y/N): "
         if errorlevel 2 goto Cleanup
       goto Loop
      :Cleanup
       for %%x in (bat dat) do del temptemp.%%x
       del --------.bat
      :End

    How it does it -- briefly.  Each time through the Loop the line:

        echo !>>temptemp.dat

    adds a "!" to the TEMPTEMP.DAT file.  After three times through the
    Loop for example, the TEMPTEMP.DAT file would contain:

      !
      !
      !

    FIND's "/C" (count) parameter can now be used to count the number of
    lines in TEMPTEMP.DAT that have a "!" in them but instead of letting
    FIND display the answer on the screen we'll redirect it's output
    into a file named TEMPTEMP.BAT:

        find "!" /c temptemp.dat>temptemp.bat

    Following along with our 3 times through the Loop example,
    TEMPTEMP.BAT would now contain:

      -------- TEMPTEMP.DAT: 3

    Now we need a BATch file that'll execute that TEMPTEMP.BAT, grab the
    "3" and stick it in an environment variable.

        echo set COUNT=%%2>--------.bat

    That's it, we're ready.  Launch TEMPTEMP.BAT with the line:

        call temptemp.bat

    and it will automatically execute "--------.BAT" (because the
    "--------" is the first 'word' in it).

    Now that "--------.BAT" is running it grabs the "3" off of the
    command line (the 2nd parameter) and sticks it in an environment
    variable named COUNT.

    In other words, it's those four lines:

         echo !>>temptemp.dat
         find "!" /c temptemp.dat>temptemp.bat
         echo set COUNT=%%2>--------.bat
         call temptemp.bat

    that are incrementing the count.

    Cool eh?  <g>

    Vernon.Frazee@f71.n135.z1.fidonet.org

 -- SPEED 1.40 #1680:

-!-
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)


 Area: Batch Language Programming                     FI 
  Msg#: 446                                          Date: 02 Dec 95  19:35:25
  From: Robert Bull                                  Read: Yes    Replied: No 
    To: Dylan Radcliffe                              Mark:                     
  Subj: Hide Output?

Hello, Dylan;

21 Nov 95 21:21, Dylan Radcliffe wrote to Gary Cassidy:

 GC>> Is there any way I can tell DOS *NOT* to display the results of
 GC>> various commands in a batch file?

If redirecting to NUL or using ANSI calls don't work or aren't appropriate, 
you could try these two tiny programs from PC Magazine (UK edition), 
December 1995, Vol. 4, No. 12;

SCRNOFF.COM  &  SCRNON.COM
--------------------------

Switch VGA screen off an on (abruptly) for hiding text you don't want the 
user to see, or as a screen blanker.

scrnoff.scr
[-------------------- CUT HERE --------------------]
E100 B8 01 12 B3 36 CD 10 B8
E108 00 4C CD 21

RCX
C
NSCRNOFF.COM
W
Q

[-------------------- CUT HERE --------------------]


scrnon.scr
[-------------------- CUT HERE --------------------]
E100 B8 00 12 B3 36 CD 10 B8
E108 00 4C CD 21

RCX
C
NSCRNON.COM
W
Q
[-------------------- CUT HERE --------------------]


     Hope this helps,

              Robert.


-!- GoldED 2.50.Beta5+
 ! Origin: Pointing at Minerva * 28 lines/12Gigs * 0181-402-3350 (2:254/33.4)


 Area: Batch Language Programming                     FI 
  Msg#: 439             Rec'd                        Date: 04 Dec 95  01:05:00
  From: Gary Smith                                   Read: Yes    Replied: No 
    To: Bat Lang                                     Mark:                     
  Subj: WAIT COMMAND ?

BL> Just an opportunity to remind everyone, that this echo spawned a
  > replacement (an updated vers with more options) for CHOICE called
  > Choice Plus.  It is 100% compatible with CHOICE, and is applicable to
  > DOS versions 3.3+.  I sent it to BFDS HQ, but it has not yet been
  > hatched.  This is the latest debugged vers:

BL> CP102.ZIP       2K  8-09-95  BATPOWER repl DOS6 CHOICE.COM, 4 DOS 3.3-6.x b

... and Choice Plus is _better_ than Choice because:

    1. the beep in response to invalid input is optional,
    2. CP doesn't have the annoying "feature" that pressing an
       invalid key cancels the timeout, converting it to an 
       infinite wait.
-!-
 * OLX 1.53 * Our policy is ALWAYS to blame the computer.

-!- WILDMAIL!/WC v4.12 
 ! Origin: The Computer Room-Pickerington, Oh  (1:226/110.0)


 Area: Batch Language Programming                     FI 
  Msg#: 450             Local                        Date: 06 Dec 95  00:13:57
  From: Bat Lang                                     Read: Yes    Replied: No 
    To: Gary Cooper                                  Mark:                     
  Subj: Scancode.Scr

 -=> Quoting Gary Cooper to Michael Laprade, [27 Nov 95  12:58:00] <=-

 GC> Try using the following to start up SCANCODE.COM.

 GC> SCANCODE /?

 GC> I found that SCANCODE did NOT work if I just executed SCANCODE
 GC> without the /? parameter.

Actually, there was a line missing from that script, but I find no
difference in the working of it with or without that line.  As for the
'/?' argument, it worked as well with just the '?'.  Good Modeming!
/\oo/\

... NetMail at 1:382/1201
-!- Blue Wave/Max v2.12
 ! Origin: The HUB * Austin TX * Centex PCUG * 512-346-1852 (1:382/1201)


 Area: Batch Language Programming                     FI 
  Msg#: 449                                          Date: 08 Dec 95  07:27:53
  From: Mark Livingston                              Read: Yes    Replied: No 
    To: Don Duvall                                   Mark:                     
  Subj: Help, again

In our last episode of "Help, again" on 02 Dec 95  01:42:00,
   we heard Don Duvall say:

 DD> But being a lazy guy I am trying to save space now  I would
 DD> like to construct a Bat file let say I call it Menu.bat.

EMFBI, but, here's what I use for menu.bat:

@echo off
:Menu
cls
echo.
echo.
echo.
echo                 0000000000000000000000000000000000000000000
echo                 0022222222222222222222222222222222222220000
echo                 0022                                 22[[00
echo                 0022  [B]lue Wave Reader             22[[00
echo                 0022  [X]TreeGold                    22[[00
echo                 0022  [C]omit                        22[[00
echo                 0022  [W]riter                       22[[00
echo                 0022  [N]orton's Utilities           22[[00
echo                 0022                                 22[[00
echo                 0022  [Q]uit to DOS                  22[[00
echo                 0022                                 22[[00
echo                 0022  So what will it be? :          22[[00
echo                 0022                                 22[[00
echo                 002222222222222222222222222222222222222[[00
echo                 0000[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[00
echo                 0000000000000000000000000000000000000000000
echo.
:GetKey
scancode
if errorlevel 49 if not errorlevel 50 goto N
if errorlevel 48 if not errorlevel 49 goto B
if errorlevel 46 if not errorlevel 47 goto C
if errorlevel 45 if not errorlevel 46 goto X
if errorlevel 17 if not errorlevel 18 goto W
if errorlevel 16 if not errorlevel 17 goto Exit
if errorlevel 1 if not errorlevel 2 goto Exit
if errorlevel 0 goto GetKey
:B
cls
cd\bluewave
bwave
cd\
goto Menu
:X
cls
c:\xtgold\xtgold
cd\
goto Menu
:C
cls
cd\comit
comit
cd\
goto Menu
:W
cls
cd\writer
ew
cd\
goto Menu
:N
cls
cd\nu
norton /m
cd\
goto Menu
:Exit
cls

Scancode was posted here just a short while ago. You can use Choice
instead of Scancode, you will just have to modify the errorlevel
testing.

Mark                                            @unicorns.metronj.org



... NJ Host for TIMENet... f'req TIMENET to join...
-!- FMail/386 1.02
 ! Origin: Unicorn's Rest * (908) 583-9238 * (1:107/623)


 Area: Batch Language Programming                     FI 
  Msg#: 441                                          Date: 11 Dec 95  10:38:09
  From: Vernon Frazee                                Read: Yes    Replied: No 
    To: John Blackmer                                Mark:                     
  Subj: volume label

JB> IDEALLY, It would compare it to my Catdisk list and inform me that
JB> it is an older version or that there is another file by that name.
JB> (hence, the need to be able to read a text file and put selected
JB> parts of the contents into an envar.) I.E. filename and/or size

    Let's say you did a:

      dir c:\dos>FILES.LST

    and the resulting FILES.LST file now contained:

       Volume in drive C is P90_VOLUME1
       Volume Serial Number is 0E5B-18CB
       Directory of C:\DOS

      .            <DIR>         03-04-95   3:04a
      ..           <DIR>         03-04-95   3:04a
      ANSI     SYS         9,065 05-31-94   6:22a
      CHKDSK   EXE        12,241 05-31-94   6:22a
      COMMAND  COM        54,645 05-31-94   6:22a
      DEBUG    EXE        15,718 05-31-94   6:22a
      QBASIC   HLP       130,881 05-31-94   6:22a
      QBASIC   INI           132 06-13-95   8:01p
      QBASIC   EXE       194,309 05-31-94   6:22a
      XCOPY    EXE        16,930 05-31-94   6:22a
             89 file(s)      4,166,629 bytes
                           203,489,280 bytes free

    If you now want to have a BATch file look for say the "QBASIC   EXE"
    line and store each portion: the FileName, FileExtension, FileSize,
    FileDate and the FileTime from that line in separate environment
    variables, here's a "quickie" that'll get you started:

      @echo off
      :EXAMPLE.BAT
       if (%2)==() goto End
       if not exist FILES.LST goto End
       type FILES.LST|find /i "%1"|find /i "%2">tmptmp.bat
       echo 1,1r,>tmptmp.scr
       echo e>>tmptmp.scr
       edlin tmptmp.bat<tmptmp.scr>nul
       echo.>>tmptmp.bat
       date<tmptmp.bat>tmptmp.bat
       type tmptmp.bat|find "Enter">tmptmp.bat
       echo set fn=%%4>enter.bat
       echo set fe=%%5>>enter.bat
       echo set fs=%%6>>enter.bat
       echo set fd=%%7>>enter.bat
       echo set ft=%%8>>enter.bat
       for %%x in (call del) do %%x tmptmp.bat
       for %%x in (tmptmp.scr enter.bat) do del %%x
       echo File Name: %fn%
       echo File Ext.: %fe%
       echo File Size: %fs%
       echo File Date: %fd%
       echo File Time: %ft%
      :End
    
    If you were to run this BATch file against the above example
    FILES.LST file with the command:

      example qbasic exe

    (note the blank space between the filename and the file extension),
    the output would be:

      File Name: QBASIC
      File Ext.: EXE
      File Size: 194309
      File Date: 05-31-94
      File Time: 6:22a

    Each of these items are also be stored in environment variables FN,
    FE, FS, FD, and FT, respectively for whatever other manipulation you
    might need to do.

    Vernon.Frazee@f71.n135.z1.fidonet.org

 -- SPEED 1.40 #1680:

-!-
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)


 Area: Batch Language Programming                     FI 
  Msg#: 411                                          Date: 03 Jan 96  11:23:00
  From: Vernon Frazee                                Read: Yes    Replied: No 
    To: Don Duvall                                   Mark:                     
  Subj: 63 valid keys for CHOICE

DD> Hi Vernon,

    Hello Don,

DD> Thanks for the help

    Sure, no problem.

DD> I combined yours, Larrys and Marks suggestions to gather and came up
DD> with my own menu.

    DD> I would like to construct a Bat file let say I call it Menu.bat.

    VF> Here's a simple example that should get you started:

    VF>   @echo off
    VF>   :Menu
    VF>    cls
    VF>    echo.
    VF>    echo  Example Menu
    VF>    echo.
DD> [ ... ]

DD> However I ran in to a couple of problems.  One I have my bat set up
DD> like yours mostly but echo off shows up on the screen before and
DD> after Example menu.

    Beginning with DOS version 3.30 (I believe) you can insert the 'at'
    symbol ("@" [Shift]-[2]) directly in front of the word "echo" to
    keep the words "echo off" from displaying on the screen.

DD> and of course I tried to use a number 10. and it didn't work I
DD> figured because of the 1 in the number.

    Correct.  DOS's CHOICE program waits for a _single_ keystroke. (No
    additional [Enter] keystroke required).

DD> If I had use a b c etc. I expect that it would have allowed me to
DD> use 26 different entries.

    Correct again.  You can use any alpha-character, numerical-digit,
    and almost all of the other special characters on the keyboard.  The
    five characters on the keyboard that won't work are:

      %   - because DOS uses it to help identify command-line parameters
            and environment variables in BATch files.
      |   - because DOS uses it as a 'pipe' symbol
      <   - because DOS uses it as an input redirection symbol
      >   - because DOS uses it as an output redirection symbol
      /   - because CHOICE uses it to help it identify the next switch

    That leaves you with the following 63 valid characters that can be
    entered directly from the keyboard and used as CHOICE options:

      abcdefghijklmnopqrstuvwxyz0123456789~`!@#$^&*()_-+={[}]"':;?.,\

    Almost all of the rest of the 256 ASCII characters are also valid
    but, most of them are a little difficult to enter directly from the
    keyboard. <g>  One exception that I use quite frequently is the
    escape character (ASCII 27).  I usually embed it as a 'hidden'
    option for exiting to DOS.  For example:

     @echo off
     :What's_next_boss
      choice /c:yna<- /n "[Y]es, [N]o, or [A]bort? (Y/N/A): "
     :Replace the "<-" above with the single escape character)
      if errorlevel 3 goto Abort
      if errorlevel 2 goto Nope
     :Do_It
      echo You selected Yes
      goto End
     :Nope
      echo You selected No
      goto End
     :Abort
      echo You pressed either [A] or [Esc]
     :End

DD> Would I have had to assign different nomenclatures to them in order?

    No, not at all.  In the above example for instance, the "yna"
    options are not in alphabetical, or any other kind of order.

    vernon.frazee@71.sunshine.com

 -- SPEED 1.40 #1680:

-!-
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)


 Area: Batch Language Programming                     FI 
  Msg#: 447                                          Date: 09 Jan 96  09:41:02
  From: William Lipp                                 Read: Yes    Replied: No 
    To: Stan Gooch                                   Mark:                     
  Subj: Re: Help!

 -=> Quoting Stan Gooch to All <=-

 SG> I have a directory of 26 files, sequentially titled A.TXT thru Z.TXT.
 SG> I want to be able to perform various options on these files one at a
 SG> time; i.e. process A.TXT the first time the batch is run, B.TXT the
 SG> next time the batch is run and so on, returning to A.TXT after 26 runs.
 SG> It must also be capable of "remembering" which file is next even after
 SG> a reboot or power-down.

Two pieces to this problem - "remembering" and "incrementing."  To remember,
save the last letter in a file.  Lets suppose we have the last letter
in an environment variable "LASTLETTER."  Then we can create a batch
file named RESTORE with the line

                  ECHO SET LASTLETTER=%LASTLETTER%>restore.bat

Now running restore.bat will restore the environment variable.  You could
run restore.bat from the autoexec.bat, or perhaps within the process
you are setting up.  The following batch file will increment the letter.
It works by interating through the letters, and doing two checks for
each letter.  If the set letter matches this letter, it deletes the set
letter.  If no letter is set, it sets the letter.  Thus when the letter
is "S", nothing happens until the iteration for S, when LASTLETTER is
cleared.  The on the iteration for T, there is no set letter, so LASTLETTER
is set to "T."  Nothing happens in the remaining iterations.

The complete list A-Z was shortened to make the lines wrap legibly.


      @echo OFF
      IF (%1)==(STEP2) GOTO STEP2
      IF (%LASTLETTER%)==(Z) SET LASTLETTER=
      FOR %%A in (A B C D E ... X Y Z) do call %0 STEP2 %%A
      GOTO END
      :STEP2
      IF (%LASTLETTER%)==() GOTO NEW
      IF (%LASTLETTER%)==(%2) SET LASTLETTER=
      GOTO END
      :NEW
      SET LASTLETTER=%2
      ECHO LASTLETTER SET TO %LASTLETTER%
      :END


 
___ Blue Wave/QWK v2.12

-!- Maximus 3.01
 ! Origin: this space available bbs (1:141/1111)


 Area: Batch Language Programming                     FI 
  Msg#: 423                                          Date: 10 Jan 96  06:55:02
  From: Vernon Frazee                                Read: Yes    Replied: No 
    To: Kurt Johnson                                 Mark:                     
  Subj: 2 parallel ports

KJ> Mrs Santa was very kind to me this year and delivered a fancy new
KJ> printer. So it now sits connected to LPT1. I had an extra
KJ> serial/parallel card around so I connected my dot matrix printer to
KJ> that which would be LPT2. ( for draft printing jobs etc. ) I would
KJ> like a way to be able to _choose_ which port to print to in DOS.
KJ> Right now it defaults to LPT1. I can choose in Windoze or OS/2 as
KJ> they have nifty print managers, but I use DOS for 90% of my
KJ> computing tasks.  ( I also use 4DOS ) Thanks in advance for any
KJ> suggestions.

    I had the same problem about a month or so ago so whupped up a
    little BATch file to make it easy to toggle the ports.  All it
    really does is use DEBUG to swap (toggle) the current LPT port
    memory addresses.  To use it, type:

      LPT

    to see the current status (printer port addresses) or

      LPT /S

    to swap (toggle) the ports.

      @echo off
      :LPT.BAT (LinePrinTer) -----------------------------------------
      :  Purpose: Display current LPT1 and LPT2 addresses or
      :           Swap LPT2 and LPT1 by using parameter /S
      : Requires: DOS's DEBUG and FIND (somewhere in PATH is cool)
      :Begin ---------------------------------------------------------
       if (%1)==() if not (%lpt1%%lpt2%)==() goto DisplayStatus
       if (%1)==(/?) if not (%lpt1%%lpt2%)==() goto DisplayStatus
       for %%x in (s S swap SWAP Swap) do if (%1)==(/%%x) goto SwapLPT
      :GetStatus -----------------------------------------------------
       echo d 40:8>tmptmp.scr
       echo q>>tmptmp.scr
       debug<tmptmp.scr>tmptmp.scr
       type tmptmp.scr|find "0000">tmptmp.bat
       echo set lpt1=%%1 %%2>0040.bat
       echo set lpt2=%%3 %%4>>0040.bat
       for %%x in (call del) do %%x tmptmp.bat
       del 0040.bat
       goto DisplayStatus
      :SwapLPT -------------------------------------------------------
       if (%lpt1%%lpt2%)==() goto GetStatus
       echo e 0040:0008 %lpt2% %lpt1%>tmptmp.scr
       echo q>>tmptmp.scr
       debug<tmptmp.scr>nul
       goto GetStatus
      :DisplayStatus -------------------------------------------------
       echo LPT1=%lpt1%
       echo LPT2=%lpt2%
      :Cleanup -------------------------------------------------------
       if exist tmptmp.scr del tmptmp.scr
      :End ----------------------------------------------------- -vjf-

    vernon.frazee@71.sunshine.com

 -- SPEED 1.40 #1680:

-!-
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)


 Area: Batch Language Programming                     FI 
  Msg#: 439                                          Date: 10 Jan 96  06:55:18
  From: Vernon Frazee                                Read: Yes    Replied: No 
    To: Joe Kron                                     Mark:                     
  Subj: Inputting to a batch file

JK> You need any one of several third-party utilities that will store
JK> user input to an environment variable.

    Here's a BATch file that'll do it for you using nothing more than
    what comes with DOS:

      @echo off
      :INPUT.BAT puts what is typed next in environment variable INPUT
       set input=
       echo INPUT.BAT
       echo Type in something and press [Enter]
       fc con nul /lb1 /n|date|find "    1:  ">temptemp.bat
       echo :Loop>>enter.bat
       echo if not (%%input%%)==() set input=%%input%% %%5>>enter.bat
       echo if (%%input%%)==() set input=%%5>>enter.bat
       echo shift>>enter.bat
       echo if not (%%5)==() goto Loop>>enter.bat
       for %%x in (call del) do %%x temptemp.bat
       del enter.bat
       echo The string you just entered:
       echo %input%
       echo has been stored in an environment variable named INPUT
      :End

    vernon.frazee@71.sunshine.com

 -- SPEED 1.40 #1680:

-!-
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)


 Area: Batch Language Programming                     FI 
  Msg#: 442                                          Date: 10 Jan 96   9:46:00
  From: Horst Schaeffer                              Read: Yes    Replied: No 
    To: Stan Gooch                                   Mark:                     
  Subj: A to Z (was: Help!)

-=> quoting Stan Gooch to All (6 Jan 96) <=-

SG> Here's a little problem that I'd be grateful for some help with.
SG> I have a directory of 26 files, sequentially titled A.TXT thru
SG> Z.TXT. I want to be able to perform various options on these files
SG> one at a time; i.e. process A.TXT the first time the batch is run,
SG> B.TXT the next time the batch is run and so on, returning to A.TXT
SG> after 26 runs. It must also be capable of "remembering" which file
SG> is next even after a reboot or power-down.

Lets assume you have made a file WHICH.BAT
with lines:     # A
                # B
                # C
                ... and so on, up to Z

Now, when you call this BAT, DOS will try to execute #.
So you must have another batch file, #.BAT. Only the first line
of WHICH.BAT will be done, because #.BAT is not CALLed.
Here is #.BAT:

        set LETTER=%1
        type WHICH.BAT | find /v "# %LETTER%" > WHICH.BAT
        echo # %LETTER%>> WHICH.BAT

This batch sets the variable LETTER, removes the first line from
WHICH.BAT (by FIND /v), and appends it at the end. That's all.

Just    CALL WHICH
to get the next %LETTER% and rotate the list.

BTW: the initial WHICH.BAT can be produced on the command line:

        for %a in (A B C......Z) do echo # %a>> WHICH.BAT

Horst.

... Q4FM 2.10 ... horst@confusion.muc.nacamar.de

-!- FM 2.02 / ScanToss
 ! Origin: HS.MUC Germany (2:2480/13.75)


 Area: Batch Language Programming                     FI 
  Msg#: 422                                          Date: 07 Feb 96  02:15:00
  From: Vernon Frazee                                Read: Yes    Replied: No 
    To: Al Frey                                      Mark:                     
  Subj: Compare System/File date

AF> Does anyone know how to compare the system date with a file date?
AF> I'd thought I could put the system date in an env variable and make
AF> the comparison, but the MS-Dos v6.22 date feature reports the system
AF> date as mm-dd-yyyy and the file dates are reported as mm-dd-yy.
AF> I started to use the following batch segment to store the date to
AF> the environment when I realized the format is different. If anyone
AF> has a suggestion as to how to strip the extraneous "19" from date or
AF> any suggestion for an alternative on making a comparison I would
AF> greatly appreciate it.
AF>   date> c:\tmp\gd.bat
AF>   echo set logdate=%%4 > c:\tmp\current.bat
AF>   call c:\tmp\gd.bat
AF> Many thanks in advance

    How about simply creating a dummy file and then grabbing the current
    system date off of it instead? <g>.   Here's an example of one way
    to get the current system date into environment variable SYS-DATE:

      @echo off
      :SYS-DATE.BAT - Store system date in evar SYS-DATE
       rem>~1.bat
       dir ~1.bat|find "~1       BAT"|find /v "e">~1.bat
       ren ~1.bat ~2.bat | echo set sys-date=%%3>~1.bat
       for %%x in (call del) do %%x ~2.bat
       del ~1.bat
       echo SYS-DATE=%sys-date%
      :End

    Note: Requires DOS's FIND (somewhere in the PATH is fine).

    Here's an example of one way to get the date of a specified filename
    into an environment variable named FILEDATE:

      @echo off
      :FILEDATE.BAT - Store file's date in evar FILEDATE
       for %%x in (%1) do if (%1)==(%%x) goto FileCHK
       echo  Error: Wildcards not accepted
       goto Syntax
      :FileCHK
       if exist %1 goto Begin
       echo  Error: File "%1" not found
      :Syntax
       echo Syntax: %0 [d:][\path\]filename[.ext]
       goto End
      :Begin
       dir %1|find /v "e"|find " ">~.bat
       echo.>>~.bat
       echo 1,1r,>~.scr
       echo e>>~.scr
       edlin ~.bat<~.scr>nul
       date<~.bat |find "Enter">~.bat
       echo set filedate=%%7>enter.bat
       for %%x in (call del) do %%x ~.bat
       for %%x in (~.bak ~.scr enter.bat) do del %%x
       echo FILEDATE=%filedate%
      :End
    
    Notes: Requires DOS's FIND and EDLIN (somewhere in PATH is fine).

           The first for-in-do line checks to see if any wildcards were
           used in parameter 1 (the filename).  If so FILEDATE.BAT
           displays an error, the syntax, and exits.

           The line under :FileCHK checks to see if the filename
           specified exists.  If so it jumps to :Begin and continues.
           If not it displays an error, the syntax, and exits.

           The first line under :Begin sticks a directory listing of the
           specified file in a file named "~.BAT".  Then next line
           simply appends a blank line to the same file.

           The next three lines strip any commas from line 1 of ~.BAT.

           The next three lines stick the file's date in evar FILEDATE.

           The next line cleans up the miscellaneous files and the last
           displays the specified file's date.  (Simply delete this last
           echo line for no display).

    And here's an example of what the screen looks like when using the
    above two BAT files:

      G:\>sys-date
      SYS-DATE=02-03-96
      G:\>filedate c:\dos\command.com
      FILEDATE=05-31-94
      G:\>
    
    You could now compare the two dates with a command something like:

      if (%sys-date%)==(%filedate%) goto Yep_we_got_a_match

 -- NetMail: 1:135/71    E-Mail: vernon.frazee@71.sunshine.com     -vjf-

-!-
  SPEED 1.40 #1680 

-!- OLMS 2.53p+ [ERSBN55C]
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)


 Area: Batch Language Programming                     FI 
  Msg#: 431                                          Date: 10 Feb 96   8:59:00
  From: Horst Schaeffer                              Read: Yes    Replied: No 
    To: Kenneth Reynolds                             Mark:                     
  Subj: Cycle .BMP (was: Is there a future for Batfiles?)

-=> quoting Kenneth Reynolds to Larry Nelson (8 Feb 96) <=-

KR> [...]
KR>     Basically, I called johnny.bmp as the wallpaper, and use
KR> the cycle routine to change the wallpaper every time I start
KR> Windows....
KR> [...]

Have a look at this solution:

Make a file BMPLIST.BAT with lines like this:

        cycle 8WK.BMP
        cycle JOHNNY1.BMP
        cycle JOHNNY2.BMP
        ... and so on, for all BMP files

and CYCLE.BAT:

        type BMPLIST.BAT | find /v/i "cycle %1" > BMPLIST.BAT
        echo cycle %1>> BMPLIST.BAT
        set wallpaper=%1

When you call BMPLIST.BAT (in your WINDOZE.BAT), only the first line
is executed, starting CYCLE.BAT with the filename as parameter %1.
CYCLE.BAT removes this first line from BMPLIST.BAT by FIND, appends it
at the end by ECHO, and returns the filename as variable WALLPAPER.

Make sure that CYCLE.BAT is in the current directory, when you call
BMPLIST.

BTW: you can generate BMPLIST.BAT for all *.BMP files (in the
current directory) on the command line:

    for %a in (*.BMP) do echo CYCLE %a>> BMPLIST.BAT

Horst.

... Q4FM 2.10 ... horst@confusion.muc.nacamar.de

-!- FM 2.02 / ScanToss
 ! Origin: HS.MUC Germany (2:2480/13.75)


 Area: Batch Language Programming                     FI 
  Msg#: 443                                          Date: 12 Feb 96  15:05:00
  From: William Lipp                                 Read: Yes    Replied: No 
    To: Kyle Dusang                                  Mark:                     
  Subj: Re: Finding today's file

 -=> Quoting Kyle Dusang to William Lipp <=-

 WL>2. Use Vernon's choice trick to split that date into characters
 WL>   to convert from Date's mm-dd-yyyy to dir's mm-dd-yy.

 KD> William,
 KD> Would you  (or Vernon, if you're reading) be so kind as to (re)post
 KD> this little gem. It sounds interesting. Thanx.

Vernon Frazee found a found a way to use the Choice command to
split a string into its component letters by assigning the string
as the list of possible responses.  This method works even with
DOS 7.0 (Win95).  In its simplest form,

      echo ; | choice /c:=%STR%;= temp2 > temp.bat

If the environment variable STR was 02-12-1996, temp.bat is

      temp2 [=,0,2,-,1,2,-,1,9,9,6,;,=]?;

The next trick is that DOS sometimes interprets "=" and "," as
token separaters between command line tokens.  If your batch
file temp2.bat contained the lines

      @echo off
      echo %1 %2 %3 %4 %5 %6 %7 %8 %9
      shift
      shift
      shift
      echo %7 %8 %9

then running temp.bat would transfer control to temp2.bat, and the
output would be

      [ 0 2 - 1 2 - 1 9
      9 6 ]?

So every letter of STR is a command line parameter of temp2.bat.  In this
case you might want to rearrange the characters to create the year
in MM/DD/YY format.  If STR had held a complete file name, you could
build a system of shifts and checks to get the disk and file name and
file extension.

Used in this simplest form, you would have to maintain both your main
batch file and the separate batch file temp2.bat.  Maintaining two
or more files for one task becomes a nightmare.  You can avoid that
hassle by using "%0" in the choice command instead of "temp2".  This
will cause the temp.bat to transfer control back to the same batch file.
To avoid an infinite loop, test for %1 as [.  I would also put temp.bat
onto my TEMP drive which is a RAM disk, and erase it when I'm finished
with it.  So the batch file would look like

      @echo off
      if (%1)==([) goto CHARS
      echo ; | choice /c:=%STR%;= %0 > %TEMP%\temp.bat
      %TEMP%\temp.bat
      :CHARS    =============================
      erase %TEMP%\temp.bat
         do the character manipulation here

(Written Feb 12, 1996)


 
___ Blue Wave/QWK v2.12

-!- Maximus 3.01
 ! Origin: this space available bbs (1:141/1111)


 Area: Batch Language Programming                     FI 
  Msg#: 435                                          Date: 11 Feb 96  13:09:02
  From: Vernon Frazee                                Read: Yes    Replied: No 
    To: Andy Guess                                   Mark:                     
  Subj: FOR in Windows 95??

AG> I have Windows 95 and use many batch files. All the time, I *need*
AG> to use the command
AG>   FOR %%v in (/%1) do something
AG> which apparently doesn't work anymore. Any suggestions on how to
AG> work around this?

    Here's a message I recently posted to Clay Cherneff on that very
    problem along with a very workable solution.

    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

CC> The "/" MUF definitely does not work in DOS 7.0  (just checked)
CC> The challenge becomes "how do we make it work?"...

    No longer having the "/" MUF is frustrating.  But, I'd almost be
    willing to bet that we here in _BATpower!_ can certainly come up
    with some viable alternatives!  Think Positive!  <g>

    For example, one of ways we've been using "/" is to separate a
    FILENAME from its EXTension.  We loop through, adding a character at
    a time to an environment variable, and when you hit the "." the
    balance of the line must be the EXTension. (Note: You do have to
    check to make sure a "." and/or anything after it actually exists).

    Following is one way to do the same using CHOICE instead of "/".
    And, not only is it smaller than what we have been using, it runs
    fine on any MS-DOS from v5.00 up thru the new v7.00 (Win95).

      @echo off
      :One way to separate a filename and extension
      :that works under DOS 5.00 thru 7.00 (Win95).
      :(The "/" MUF does not work under DOS v7.00).
      :--------------------------------------------
       if (%1)==() goto End
       if (%1)==([) goto GotParms
       for %%x in (~fn~ ~fe~) do set %%x=
       echo;;|choice /c:=%1;= "%0 ">~tmptmp~.bat
       ~tmptmp~
      :GotParms -----------------------------------
       del ~tmptmp~.bat
       shift
      :GetFileNameLoop ----------------------------
       if (%1)==() goto Done
       if not (%~fn~%)==() set ~fn~=%~fn~%%1
       if (%~fn~%)==() set ~fn~=%1
       shift
       if (%1)==(.) goto GetFileExtLoop
       goto GetFileNameLoop
      :GetFileExtLoop -----------------------------
       shift
       if (%1)==() goto Done
       if (%1)==(]?) goto Done
       if not (%~fe~%)==() set ~fe~=%~fe~%%1
       if (%~fe~%)==() set ~fe~=%1
       goto GetFileExtLoop
      :Done ---------------------------------------
       echo FileName: %~fn~%
       echo File Ext: %~fe~%
      :End ---------------------------------- -vjf-

    (Note: I'm sure this can probably be whittled down a bit -- just
    don't have the time at the moment).

    Oh, and another benefit of using CHOICE is it automatically UPPER-
    cases users input.  No need to run the "PATH=%1" routine to do so.

    The above idea can also be used to look for whatever characters
    necessary.  For instance, the ":" character in time output, the "-"
    in the date, the ":" after the drive letter, the "\"(s) in a path,
    commas in file sizes, etc., etc.

    In fact, now that I think about it, we may just find that using
    CHOICE instead of "/" is actually quite a bit easier!

    KewwweL! <G>

    -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

 -- NetMail: 1:135/71    E-Mail: vernon.frazee@71.sunshine.com     -vjf-

 -- SPEED 2.00 #1680:

-!- OLMS 2.53p+ [ERSBN55C]
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)


 Area: Batch Language Programming                     FI 
  Msg#: 450             Rec'd                        Date: 13 Feb 96  18:01:00
  From: Ron Warder                                   Read: Yes    Replied: No 
    To: Bat Lang                                     Mark:                     
  Subj: Re: MODE MUF/s

 >Congratulations, Ron!!

  Thanks, Bat ( I think <g> ). At present, I haven't had much time to consider
when the next version will be published, but I will be collecting additional
MUF's on-going.

  If anyone here has any suggestions or comments regarding the MUF list, please
send netmail to my origin.




-!- SLMAIL v4.0a  (#0304)
 ! Origin: Free Spirit =*= SL/RIP =*= 301-283-0917 =*= V32b/HST (1:109/132)


 Area: Batch Language Programming                     FI 
  Msg#: 442                                          Date: 16 Feb 96  13:47:01
  From: Vernon Frazee                                Read: Yes    Replied: No 
    To: Stephane Cote                                Mark:                     
  Subj: huh?

SC> What kinda things can you do with a bat file?

    A BATch file is a file with a .BAT extension that contains a list of
    DOS instructions you want to execute and programs you want to run.
    When you execute the batch file, DOS looks at each line and executes
    the instructions or runs the program specified on that line just as
    if you had typed it in directly.

    Once you master its dozen or so batch commands, you can have DOS
    automate all your daily chores and chop tedious file management
    tasks down to size.  You can even use these commands to dial your
    phone, look up names and addresses, keep track of your appointments,
    or even create an entire menu-driven front end to your system.  All
    at the touch of a key or two.

    Batch files are like computer programs and as such share some of the
    same basic features.  One is the 'conditional' ability to execute
    commands only when the proper conditions are met.  Other features
    are the ability to loop repeatedly, or use variables with changeable
    values, or divide jobs into small subroutines.  Microsoft's batch
    file language isn't elegant, and it needs a little help.  But it
    packs a wallop into its few commands and gives you astonishing
    control over your system.

    Source: Paul Somerson 1987/88

 -- NetMail: 1:135/71    E-Mail: vernon.frazee@71.sunshine.com     -vjf-

-!- OLMS 2.53p+ [ERSBN55C]
 ! Origin: SOX! Live from Hialeah_FL_USA (305) 821-3317 (1:135/71)

 Area: Batch Language Programming                     FI 
  Msg#: 435                                          Date: 19 Feb 96  01:37:04
  From: William Lipp                                 Read: Yes    Replied: No 
    To: Stamatis Kantartzis                          Mark:                     
  Subj: %1

 -=> Quoting Stamatis Kantartzis to All <=-

 SK> Can anyone tell me if there's a way to make a batch program goto a
 SK> label defined by %1 and if there isn't a %1 (if I don't type one in) to
 SK> go to another label or the next label in sequence?

The straight forward easy to understand when you come back to it solution
is

       if (%1)==()  goto NONE
       goto %1

The cleverer solution that will confound even you when you try to
change things in 18 months is

      goto %1 NONE


neither of these works very well if you enter "INVALID" and there
isn't a label called "INVALID" though.  The obvious way through that
is to explicitly test for every valid label, as in

      if (%1)==(GOOD1) goto GOOD1
      if (%1)==(GOOD2) goto GOOD2
      if (%1)==(GOOD3) goto GOOD3

The more complicated and confusing solution would be to use find
in the batch to see if the label exists.
 
___ Blue Wave/QWK v2.12

-!- Maximus 3.01
 ! Origin: this space available bbs (1:141/1111)
