home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1995 November
/
PCWK1195.iso
/
inne
/
podstawy
/
dos
/
4dos
/
4uzytki
/
tfc22c.exe
/
TFC.BTM
< prev
Wrap
Text File
|
1994-01-11
|
12KB
|
325 lines
loadbtm on
@echo off
REM =========================================================================
REM
REM TFC Tobi's Floppy Cataloguer Version 2.2c 1-11-94, 8:38 PM
REM
REM This program is released into the Public Domain
REM Feel free to make changes to this program but
REM don't Remove my name and address ...
REM Let me know if you have any enhancements or if
REM you find errors ...
REM
REM New in Version 2.2c:
REM . Workaround for Escape Bug in 4dos 5.0c
REM (Thanks Ilkka Puranen 2:221/360.26)
REM
REM New in Version 2.2b:
REM . 'Drive B: bug' fixed
REM
REM New in Version 2.2:
REM . Allow removal Catalogue Entries
REM . Added Quit Option, when Scanning Disks without
REM descriptions
REM . Write Free Space on Floppy to the database
REM . Corrected Handling of 0 Size PROG.TFC
REM
REM New in Version 2.1:
REM . Minor Error Corrections
REM . Corrected Problems with Disklables containing a Space
REM
REM New in Version 2:
REM . Checks if there is a Disklabel
REM . Checks if there is a Description for each File
REM . Always saves the Database to a file called PROGS.TFC
REM in the same dir as TFC.BTM is located
REM . Uses TCV /GREP to Remove old Disks from Progs.TFC
REM . besides the entry for each file on the floppy there is
REM always added a line containing DISK SIZE and USED space
REM to the catalogue.
REM . Can also add Disks without Descriptions to the Archive,
REM just stating Label,Used Disk Space,Data of Last Modified
REM File, <40 Chars of Description and the Scan Date.
REM
REM
REM Thanks for Additions and Corrections to:
REM
REM . David Frey (no e-Mail)
REM . Thomas Ludwig (ludwig@informatik.tu-muenchen.de)
REM . Maettu Studer (no e-Mail)
REM
REM
REM Written by
REM Tobi Oetiker (oetiker@stud.ee.ethz.ch or 2:301/516.2@fido)
REM Gallusstrasse 25 / CH-4600 Olten / FAX +41 62 32 61
REM
REM
REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
REM =========================================================================
REM ::::::::::: Test if the correct Version of 4Dos is in the System ::::::::
REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
IFF "%_4VER" LT "4.0" THEN
BEEP
TEXT
** ERROR: Sorry but TFC needs 4DOS 4.x to run :-(
You can get the newest Version from Simtel via FTP or
order it from a shareware distributor.
ENDTEXT
QUIT
ENDIFF
REM =========================================================================
REM ::::::::::: Give advice to the novice User ::::::::::::::::::::::::::::::
REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
SETLOCAL
UNALIAS *
IFF %@UPPER[%1]x NE A:x .AND. %@UPPER[%1]x NE B:x .AND. "%@SUBSTR[%1,1,%@EVAL[%@LEN[%1]-2]]"x NE %1x THEN
TEXT
TFC - Tobi's Floppy Cataloguer Version 2.2 - 10-27-93, 5:34 PM
TFC helps you to keep organized all these Floppy Disks where you store
your PD and Shareware.
It creates and maintains a comma delimited database called PROGS.TFC
containing information about the files on the Floppies you scan, including
the 4DOS-Description of each File.
The database can now be either viewed and searched with TCV, which comes
with TFC or it can be imported into Programs like Paradox or dBase.
Usage: TFC drive | "label"
drive is the disk drive you want to scan from
label is a Floppy-Disk Label you want to remove from the catalogue
Example: tfc a: -------------> scan drive a:
tfc "games 8" ------> remove the catalogue entries for the "games 8"
Floppy
Written by Tobi Oetiker (oetiker@stud.ee.ethz.ch or 2:301/516.4@fidonet)
Gallusstrasse 25 / CH-4600 Olten / FAX +41 62 32 61
ENDTEXT
GOTO ERREXIT
ENDIFF
REM =========================================================================
REM ::::::::::: Test if there is enough Environement space for TFC.BTM ::::::
REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
IFF %_ENV LT 180 THEN
BEEP
TEXT
** ABORTED ... you need at least 180 byte of free environment space
after TFC is started ... Either use
set var=
to make space or rise the environment value in your
4dos.ini file.
* var stands for any environment variable. You get a list
of your variables if you type set at the command prompt.
Using the command "memory" you can check how much space is
left ...
ENDTEXT
goto errexit
ENDIFF
REM =========================================================================
REM ::::::::::: Setup Path for PROGS.TFC file :::::::::::::::::::::::::::::::
REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
SET target=%@SEARCH[%0]
IF "%target" EQ "" SET target=%@FULL[%0]
SET target=%@PATH[%target]progs.tfc
REM =========================================================================
REM ::::::::::: Setup TEMP file :::::::::::::::::::::::::::::::::::::::::::::
REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
SET temp=%@UNIQUE[%@PATH[%target]]
ECHO.
ECHO TFC - Tobi's Floppy Cataloguer Version 2.2 - A 4DOS BTM File
ECHO.
REM =========================================================================
REM ::::::::::: Is it a Removal Session ??? :::::::::::::::::::::::::::::::::
REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
IFF "%@substr[%1,1,%@eval[%@len[%1]-2]]" eq %1 then
SET dsklbl=%@LOWER[%1]
GOSUB REMOVAL
echo.
GOTO NORMENDE
ENDIFF
REM =========================================================================
REM ::::::::::: Wait for Floppy to be inserted into Drive :::::::::::::::::::
REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
SET t=j
:again
IFF %@READY[%1] EQ 0 THEN
SET t=
ECHOS %@CHAR[13]=:- please INSERT next disk ... or press any key to EXIT %@char[255]
INKEY /W1 %%t
IF "%t" NE "" GOTO normende
ELSE
GOTO read
ENDIFF
GOTO again
REM =========================================================================
REM ::::::::::: Has this Floppy a electronic label attached ? :::::::::::::::
REM ::::::::::: If not, ask user to Provide One ! :::::::::::::::::::::::::::
REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
:read
IFF "%@LABEL[%1]" EQ "unlabeled" THEN
BEEP
ECHO %@CHAR[13]** ERROR %@CHAR[255]
LABEL %1
ECHO.
ECHO.
ENDIFF
REM =========================================================================
REM ::::::::::: Scan existing PROGS.TFC file for entries about ::::::::::::::
REM ::::::::::: the Floppy now being processed and remove them ::::::::::::::
REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
SET dsklbl="%@LABEL[%1]"
GOSUB REMOVAL
REM =========================================================================
REM :::::::: Look if there are no files with description on the floppy ::::::
REM :::::::: and offer appropriate action to be taken :::::::::::::::::::::::
REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
IFF NOT EXIST %1descript.ion THEN
ECHO %@CHAR[13]** HEY there are no files with Description on this Disk ... %@CHAR[255]
TEXT
Press [L] : To add only the LABEL of the Disk plus 40 Chars of Description
to the PROGS.TFC File.
[D] : To describe each File on the Disk and add them to the Catalogue.
[Q] : To Quit.
ENDTEXT
:nolab
BEEP
INKEY %@CHAR[13]YOUR CHOICE: %%t
ECHO.
IF "%@UPPER[%t]" EQ "Q" GOTO change
IF "%@UPPER[%t]" NE "L" .AND. "%@UPPER[%t]" NE "D" GOTO nolab
ECHO.
REM =========================================================================
REM ::::::::::: Get the some short description about the floppy in the ::::::
REM ::::::::::: drive and add it along with more Info to PROGS.TFC ::::::::::
REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
IFF "%@UPPER[%t]" EQ "L" THEN
ECHO Please enter a Description for %@LABEL[%1] (Less than 40 Chars)
INPUT Description: %%d
SET t=0
FOR %a IN (%1*.*) DO IF %@DATE[%@FILEDATE[%a]] GT %t SET t=%@DATE[%@FILEDATE[%a]]
ECHO "%@LOWER[%@LABEL[%1]]","%@MAKEDATE[%t]","%@DISKTOTAL[%1,k]kB DISK",%@DISKUSED[%1,b],"%@SUBSTR[%d,0,40]","%_DATE" >>%target
SET d=
ECHO.
ECHO.
GOTO CHANGE
ENDIFF
ENDIFF
REM =========================================================================
REM ::::::::::: Ask the user for a Description for each file which is :::::::
REM ::::::::::: is yet undescribed :::::::::::::::::::::::::::::::::::::::::::
REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
:desc
FOR %a IN (%1*.*) DO (
IFF "%@DESCRIPT[%a]" EQ "" THEN
ECHO.
ECHO.
ECHO I have no Description for %a so please ... %@CHAR[255]
DESCRIBE %a
ECHO.
ENDIFF
)
REM =========================================================================
REM ::::::::::: This was the first line ever written for this Batch it is ::
REM ::::::::::: infact the very heart of it! Adding a Line to PROGS.TFC for :
REM ::::::::::: each file on the Floppy :::::::::::::::::::::::::::::::::::::
REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
ECHOS %@char[13]** Adding new entries from Disk: "%@label[%1]" %@char[255]
ECHO "%@LOWER[%@LABEL[%1]]","00.00.00","%@DISKTOTAL[%1,k]kB DISK",%@DISKUSED[%1,b],"▓▓▒▒░░ FLOPPY ░░▒▒▓▓ ---> %@EVAL[%@DISKTOTAL[%1,k]-%@DISKUSED[%1,k]] kilo free","%_DATE" >>%target
FOR %a IN (%1*.*) DO ECHO "%@LOWER[%@LABEL[%1]]","%@FILEDATE[%a]","%@NAME[%a].%@EXT[%a]",%@FILESIZE[%a,b],"%@DESCRIPT[%a]","%_DATE" >>%target
REM =========================================================================
REM ::::::::::: Get the user to change the Floppy or to exit the program ::::
REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
BEEP
:change
SET t=
IFF %@READY[%1] EQ 1 THEN
ECHOS %@CHAR[13]=:- please REMOVE disk ... or press any key to EXIT %@CHAR[255]
INKEY /W1 %%t
IF "%t" NE "" GOTO normende
ELSE
GOTO again
ENDIFF
GOTO change
REM =========================================================================
REM ::::::::::: Remove %dsklbl Entries form %target :::::::::::::::::::::::::
REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
:removal
IFF EXIST %@PATH[%target]TCV.EXE .AND. EXIST %target THEN
ECHOS %@CHAR[13]** Removing Entries for: %dsklbl from "%@name[%target].tfc" %@CHAR[255]
IF %@filesize[%target] GT 0 %@PATH[%target]TCV /GREP >%temp
DEL %target /Q
MOVE %temp %target /Q
ELSE
IFF EXIST %target THEN
BEEP
ECHO %@CHAR[13]** ERROR Couldn't find TCV.EXE %@CHAR[255]
GOTO ERREXIT
ENDIFF
BEEP
ECHO %@CHAR[13]** ERROR I Can't finde %target to remove from. %@CHAR[255]
GOTO ERREXIT
ENDIFF
RETURN
REM =========================================================================
REM ::::::::::: Clean Up the mess done in Memory by TFC.BTM :::::::::::::::::
REM \/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\
:normende
ECHO.
ECHO The TFC File: "%target" is Up To Date
ECHO.
:errexit
IF EXIST %temp DEL %temp /Q
ENDLOCAL