home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
dskstruc
/
flop50c.arj
/
FLOPPY.BAT
< prev
next >
Wrap
DOS Batch File
|
1992-05-17
|
4KB
|
124 lines
@ECHO OFF
REM To format floppies
REM First check if DOS 5.0 is installed.
cls
c:
cd\dos
:TEST
RR D
if errorlevel 50 goto ANSI
echo This BATCH file only works
echo on a system with DOS 5.0 installed!
pause
goto QUIT
:ANSI
RR A
if errorlevel 1 goto DDRIVE
if errorlevel 0 goto ANSBAD
:ANSBAD
ECHO.
ECHO This program uses ANSI color, and ANSI.SYS was not
ECHO found loaded in your CONFIG.SYS.
ECHO.
ECHO You should edit your CONFIG.SYS to add the following statement;
ECHO.
ECHO. DEVICE=drive:\directory\ANSI.SYS
ECHO.
ECHO example
ECHO DEVICE=C:\DOS\ANSI.SYS
ECHO.
ECHO.
ECHO Reminder! Reboot to have changes take effect, anytime after
ECHO editing your AUTOEXEC.BAT or CONFIG.SYS
ECHO.
pause
goto QUIT
:HELP
CLS
ECHO.
ECHO DOS Version 5.0 has given us some new switches to use in the
ECHO FORMATTING process.
ECHO.
ECHO This program uses the following switches for the various choices
ECHO which are available from the "Select TYPE of Format" Menu.
ECHO.
ECHO [B]ootable uses the [/S] switch, which copies your system files
ECHO to the disk. (IO.SYS, MSDOS.SYS, and COMMAND.COM)
ECHO.
ECHO [N]ew is for disks that have NEVER been FORMATTED and uses the
ECHO [/U]nconditional switch. It destroys all data on the
ECHO disk, but there's none there anyways, right!
ECHO This greatly increases format process time.
ECHO You may also use this type if a particular
ECHO disk is having READ & WRITE errors during use.
ECHO.
ECHO.
ECHO.
ECHO [Q]uick uses both [/Q][/U] switches. This deletes the File
ECHO Allocation Table (FAT) and the root directory of
ECHO a previously formatted disk, but does not scan the disk
ECHO for bad areas. So you should use this on disks that
ECHO are in GOOD condition.
pause
ECHO.
ECHO [S]afe Format is the slowest, but it's exactly as the name implies!
ECHO This is the DOS default, saving UNFORMAT information,
ECHO and VERIFYING as FORMAT does it's thing!
ECHO.
ECHO For more information on FORMAT & UNFORMAT switches
ECHO at the DOS prompt type:
ECHO.
ECHO HELP FORMAT
ECHO HELP UNFORMAT
pause
:DDRIVE
CLS
TYPE FLOP.SCR
set DRIVE=
ECHO.
RR C " ( DRIVE A or B ? Enter=A ) " AB~}ƒ/X /Vdrive=
if errorlevel 159 goto HELP
if errorlevel 126 goto QUIT
if "%DRIVE%"=="}" set DRIVE=A
if "%DRIVE%"=="B" set DRIVE=B
if "%DRIVE%"=="A" set DRIVE=A
:DSIZE
set SIZE=
RR C " ( SIZE 1, 2, 3, 4, 5 Enter=1.44MB ) " 12345~}ƒ/X /Vsize=
if errorlevel 159 goto HELP
if errorlevel 126 goto DDRIVE
if "%SIZE%"=="}" set SIZE=1.44MB
if "%SIZE%"=="5" set SIZE=1.2MB
if "%SIZE%"=="4" set SIZE=360K
if "%SIZE%"=="3" set SIZE=2.88MB
if "%SIZE%"=="2" set SIZE=1.44MB
if "%SIZE%"=="1" set SIZE=720K
:TYPE
set TYPE=
RR C " ( TYPE B , N, Q , S Enter=New ) " BNQS~}ƒ/X /Vtype=
if errorlevel 159 goto HELP
if errorlevel 126 goto DDRIVE
if errorlevel 125 set TYPE=/U
if "%TYPE%"=="S" set TYPE=
if "%TYPE%"=="Q" set TYPE=/Q/U
if "%TYPE%"=="N" set TYPE=/U
if "%TYPE%"=="B" set TYPE=/S
ECHO Preparing to FORMAT a Floppy in %DRIVE%: /F:%SIZE% %TYPE%
ECHO.
RR N " Do you want to proceed ? (Y/n) Enter=Y " YN}
if "%GET%"=="}" goto DFORMAT
if "%GET%"=="Y" goto DFORMAT
if "%GET%"=="N" goto DDRIVE
:DFORMAT
FORMAT.COM %DRIVE%: /F:%SIZE%%TYPE%
if errorlevel 4 if not errorlevel 5 ECHO Fatal Error Has Occurred!
if errorlevel 3 if not errorlevel 4 ECHO User Pressed CTRL-C to Abort!
if errorlevel 0 if not errorlevel 1 ECHO Operation Successful!
goto DDRIVE
:QUIT
set SIZE=
set DRIVE=
set TYPE=
set GET=
CLS