home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1995 November
/
PCWK1195.iso
/
inne
/
podstawy
/
dos
/
4dos
/
4uzytki
/
ez-btm11.exe
/
FORMAT1.BTM
< prev
next >
Wrap
Text File
|
1994-02-02
|
4KB
|
116 lines
: FORMAT1.BTM
: Allows formatting for various diskette sizes, based on
: Ray Tackett's 4MENU.BTM, included in SAMPLES.BTM (in the
: 4DOS package. If you had to copy 4DOS.COM as COMMAND.COM for
: misbehaving programs, you must also have COPYCOM.BTM accessible.
: (Itamar Even-Zohar, Porter Chair, Tel Aviv U.,
: itamarez@plato.tau.ac.il)
::===> THIS VERSION handles computers with ONE FLOPPY DRIVE (3½).
setlocal
cls
: If there are less than 300 bytes for aliases, save current aliases
: to a file called ABBR on the last available disk (if a RAM drive
: exists, then ABBR will be created on that drive), then unload all
: current aliases.
if .%temp==. call settemp
iff %@eval[%_alias] lt 300 then
alias >%temp\abbr
unalias *
endiff
: Set the drives for 3½ and 5¼ diskettes (which may be defined
: differently on different machines).
: ATTENTION! B: is a 3½ drive; A: is a 5¼ drive. Change if it is
: otherwise in your system.
set disk3=A:
set disk5=A:
: Define several aliases which will be used several times in the
: remainder of this batch file.
alias choice `elseiff "%userchoice" == "%1" then`
alias ech `echo. ^ echo **Formatting:`
: if a file 'ABBR' was created, erase it
alias quix `iff exist %temp\abbr then^unalias *^alias /R %temp\abbr^del /q %temp\abbr^endlocal^else^endlocal^quit^endiff ^quit`
alias fix `goto fix`
cls
:formattype
screen 6 0
text
Enter format type:
0. exit
1. Format unconditionally ("format /u")
2. Save unformat information (DOS default)
endtext
screen 11 2
inkey /K"0[esc]12" Which option? %%userchoice
iff "%userchoice"=="0" .or. %userchoice==%@char[27] then
echo (Operation canceled)^quix
choice 1
set format=format /u
rem ^^^^^^^ (change if you opted for a different solution)
choice 2
set format=format
rem ^^^^^^^ (change if you opted for a different solution)
endiff
:
cls
:dispmenu
screen 6 0
text
Enter your choice:
0. EXIT
S. Format diskette with system
───────────────────────────
1. Format a 3½ diskette of 720 K
2. Format a 3½ diskette of 1.44 M
endtext
:selection
inkey /K"0[esc]1234s" Which option / further option? %%userchoice
iff "%userchoice"=="0" .or. %userchoice==%@char[27] then
echo (Operation canceled)^quix
choice S set 1=/s ^ set trans=on ^goto selection
choice 1 set disk=%disk3
ech 720 in 1.44M Drive %disk
%format %disk /n:9 /t:80 %1
gosub fix
quix
choice 2 set disk=%disk3
ech 1.44M in Drive %disk
%format %Disk %1
gosub fix
quix
choice 3 set disk=%disk5
ech 362 in 1.2M Drive %disk
%format %Disk/4 %1
gosub fix
quix
choice 4 set disk=%disk5
ech 1.2 in Drive %disk
%format %Disk %1
gosub fix
quix
else
: (The user entered an invalid option)
scrput 23 0 bri whi on red Invalid choice, try again
endiff
: Loop back to the beginning
goto dispmenu
:fix
: This "fix" runs a batch file to handle copying of MS-DOS original
: COMMAND.COM to diskettes formatted with /s. In 4DOS, if you had
: to have 4DOS.COM under the name COMMAND.COM for misbehaved
: programs like XyWrite and Nota Bene. The original COMMAND.COM
: must be kept in your ROOT directory under the name COMMAND.OLD, or
: in an MSDOS subdirectory under COMMAND.COM. Make sure that
: COPYCOM.BTM is in your path.
if %@eval[%?] ge 3 (echo Disk not formatted^return)
if not exist %@search[COPYCOM.BTM] (echo COPYCOM.BTM not found^quix)
iff .%trans==.on then
call copycom %disk
cancel
endiff
return