Bill's Batches

by Bill Ghysen

The FORM.BAT discussed in this article should be useful for many members, as it will provide many different ways of formatting/erasing both 3.5" and 5.25" diskettes quickly (and safely if desired)...


Before I start, just a comment regarding last month's article; it would appear that our editor's word processor is not capable of reproducing the Alt-177, Alt-196, Alt-205 and Alt-240 characters. If as a result you are having difficulties in running ADMAN.BAT, please give me a call on 287 1234 and I'll fill you in on how to rectify the problem.

[It's not that the editor's word processor can't reproduce them, it's just that the more unusual characters that Bill uses aren't converted from text as a matter of course - Alt-177 is ±, Alt-196 is Ä, Alt-205 is Í, Alt-240 is ð -Ed]

You will notice that FORM.BAT (short for format) uses the more traditional "if %VAL%==" arrangement, instead of using "goto %VAL%" as in last month's article. This is required because additional parameters need to be created to follow on from the first menu choice of 8 different operations.

Whereas the initial choice is between Quick erase, Format etc., FORM.BAT's second menu increases that choice to 40 by giving you a selection of 5 different types of diskettes, including a 5.25" x 720K non-standard size.

Please refer to my article of June 94 SIXTEEN BITS on how to go about running the TSR 800.COM to allow formatting of 360K (DD) diskettes to 720K. (Perhaps I could add here that for several years I have been formatting hundreds of old 360K diskettes to 720K for use in my library setup and up till now have not had a single glitch with any of them, despite using them frequently).

Actually there is only a choice of A or B drive needed for FORM.BAT's Inspect, Quick erase, Erase, Unformat and Add System Files, as in each case the diskette's structure is not altered. However, for the sake of uniformity I have kept the same second menu layout for all eight functions. Just press 2 or 4 for drive A:, or 1, 3 or 7 for drive B:.

Please note that the DOS QuickFormat command (it actually quick erases) has a few problems to watch out for. For example, it won't look at an unformatted or misformatted diskette. It just tells you "Not ready. Quickformat another (Y/N)?" or you could even finish up with the notorious "General failure ..." with a diskette loaded. And when it does manage to read something of a non-standard nature, it will ask you to do a full format, in which case it will try to format eg. a 360K diskette to 1200K, with drastic results of course.

I played around for quite some time trying to find a utility that could detect the structure of a diskette, if any, so that the type of format/erase function required could be determined via error levels and thus make the operation completely automatic. I got close a couple of times, but not close enough to make it foolproof.

In writing FORM.BAT I have tried to make the selections as easy as possible, but you will still have to decide whether your diskette is in a good "used" condition, so that it only needs a quick erase or whether its condition is suspect and needs a full format, which takes much longer of course.

If you don't use an "unconditional (/U)" format or reformat a diskette to a different size, FORMAT performs a "safe" format. It clears the file allocation table and root directory of the disk but does not delete any data. In other words, it leaves an image. You can then use UNFORMAT to recover the diskette if you formatted it by mistake.

As this is a bit like closing the door after the horse has bolted, I have included as the first item "Inspect contents and size" of diskette, which to me seems a more sensible way to go about it. So generally speaking, if you know what is on your diskettes use "Quick erase without image" or if unformatted use "Format new & unreadable" as this is the quickest method.

Anyway the choice is yours.

Note 1

The first time BATMNU calls FORM.BAT it looks for its default menu from :menu to :end_menu. Its output variable is then set to ê, so that it does not clash with the next stage.

Note 2

This time BATMNU calls FORM.BAT DISK, meaning that it will now look for :disk to :end_disk as its menu. Its output variable is this time converted to 4 batch parameters, so that FORM.BAT calls itself with %0, uses A: or B: drive as %1, the diskette size as %3 and BYP as %2 to be able to bypass both its menus. Please note that as there are two 720 diskette formats, one has been called 720 and the other 72O with a capital "O".

Note 3

To use the DOS FORMAT command to format a 5.25" diskette to 720K, the standard /F:720 can't be used and instead the /T:80/N:9 (80 tracks and 9 sectors) needs to be used (as well as 800.COM).
REM start of FORM.BAT
@echo off
if %2'==BYP' goto byp

:beg
C:\
cd\
REM see Note 1.
BATMNU FORM.BAT
set ê=%VAL%
if %ê%==ESC goto end
REM see Note 2.
BATMNU FORM.BAT DISK
if %VAL%==ESC goto end
if %VAL%==720 %0 A BYP 720
if %VAL%==144 %0 A BYP 1440
if %VAL%==360 %0 B BYP 360
if %VAL%==72O %0 B BYP 720
if %VAL%==120 %0 B BYP 1200

:menu
window, kyel±, s1, v31, ~, p0, no_margin, no_bar h_format, bred, d5, t2
title, Format etc. Diskette(s)

option,Inspect contents and size
option,Quick erase without image
option,Format new & unreadable
option,Multiple formats without image
option,Erase good used & keep image
option,Reformat suspect & keep image option,Unformat - if image exists
option,Add System Files

f_format, bred
footer,Select high-lighted character or Esc to exit
:end_menu

:disk
window, kyel±, s1, v3, ~, p0, no_margin, no_bar
h_format, bred, d5, t2
title,%ê%

option,720 diskette  in drive A,2
option,1440 diskette in drive A,2
option, ----------------------
option,360 diskette  in drive B
option,72O diskette  in drive B
option,1200 diskette in drive B

f_format, bred
footer,Select high-lighted character or Esc to exit
:end_disk

:byp
if %ê%==Multiple goto mul
cls
if %ê%==Unformat goto unf
echo.
if %ê%==Add goto ins
if %ê%==Inspect goto ins
echo Preparing to %ê% (Ctrl-C to exit) 

REM this flashing yellow on red WARNING needs (
ANSI.SYS
echo •[33;41;1m•[5m W A R N I N G :  All files (
will be erased !! •[m•[37;44m
cd\DOS
if %VAL%==72O goto by2
if %ê%==Quick FORMAT %1:/Q/U/F:%3
if %ê%==Format FORMAT %1:/C/U/F:%3
if %ê%==Erase FORMAT %1:/Q/F:%3
if %ê%==Reformat FORMAT %1:/C/F:%3
goto end

:by2
REM see Note 3.
if %ê%==Quick FORMAT %1:/Q/U/T:80/N:9
if %ê%==Format FORMAT %1:/C/U/T:80/N:9
if %ê%==Erase FORMAT %1:/Q/T:80/N:9
if %ê%==Reformat FORMAT %1:/C/T:80/N:9
goto end

:ins
echo To %ê%, insert diskette in drive %1: and
pause
if %ê%==Add goto add
SDIR %1: /C/F/V
pause
goto beg

:add
C:
cd\
DOS\SYS %1:
pause
goto end

:mul
F:KF 0 32
FORMATQM %1: %3K
goto end

:unf
DOS\UNFORMAT %1:
pause
goto end

:end
cls
set ê=
set VAL=
REM end of FORM.BAT
SDIR and FORMATQM are a couple of my old faithful shareware utilities that have been around for years and are still doing a good job. The latter will happily format 5.25" at 720K amongst others and will start up multiple formats simply by opening and closing the drive's gate.

Please give me a ring on 287 1234 if you need any of the programs mentioned. Happy Batching!

Copyright Notice


Go to PCUG Home Page

Go to SIXTEEN BITS Main Menu

Go to SIXTEEN BITS September 95 Contents