home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1995 November
/
PCWK1195.iso
/
inne
/
podstawy
/
dos
/
4dos
/
4uzytki
/
arconv01.exe
/
TO1.DAT
< prev
next >
Wrap
Text File
|
1993-06-30
|
2KB
|
85 lines
@echo off
loadbtm on
setlocal
:: to.btm, 27 Jun 1993, by E.T.C, Ver 1.00
:: Run with no arguments for a syntax description
:: This batch file converts archive files from one format to another.
:: It calls a.btm & da.btm to create & extract archives, So if you wish
:: to add archive formats, you must modify a.btm & da.btm.
:: to.btm maintains a file of statistics.
:: If you wish to keep the logging, change line to the correct path.
:: The archive formats recognized are the ones in a.btm and da.btm
:: At the current version, no extra parameters can be passed to archiver.
:: Options:
:: -max will delete the smaller file (either original or -converted file).
:: -y will delete without prompting the archive to be deleted (either the
:: original file, or the larger one, with -max).
:: -n will NOT delete, and will not prompt for deletion.
:: The above two are good for batch mode. Default prompts before deletion.
:: anyways appear when comverting to a filename that already exists.
:: Quits with 0 for success, 1 for error, so preferably, have a.btm & da.btm
:: return the same, for easy detection.
set DEFAULT=arj
:: Syntax checking:
if "%1" == "" goto syntax
iff "%1" == "-max" then
set MAX=TRUE
shift
else
set MAX=FALSE
endiff
if "%1" == "" goto syntax
:: Default deletion: prompt before.
set DELETE=del /p
iff "%1" == "-y" then
set DELETE=del /q
shift
else
iff "%1" == "-n" then
set DELETE=rem
shift
endiff
endiff
if "%1" == "" goto syntax
iff "%2" == "" .or. exist %1 .or. isdir %1 then
set ARC=%DEFAULT
else
set ARC=%1
shift
endiff
if isdir $$$$TEMP.$$2 .or. exist $$$$TEMP.$$2 goto error
md $$$$TEMP.$$2
:: Storage for already-converted archives
for /a-d %RUN in ( %& ) do (
iff "%RUN" != "$$$$TEMP.$$2" then
iff "%RUN" != "DESCRIPT.ION" then
echo Working on %RUN
gosub main_loop
endiff
endiff
)
goto end
:main_loop
set FILENAME=%@NAME[%RUN]
if "%@EXT[%RUN]" == "" goto syntax
iff %@LOWER[%@EXT[%RUN]] == %@LOWER[%ARC] then
color bright blink red on black
echo Cannot convert file to itself!
color white on black
goto syntax
endiff
:: Convert:
echo Converting from %@EXT[%RUN] to %ARC...
if isdir $$$$TEMP.$$1 .or. exist $$$$TEMP.$$1 goto error
md $$$$TEMP.$$1
cd $$$$TEMP.$$1