home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1995 November
/
PCWK1195.iso
/
inne
/
podstawy
/
dos
/
4dos
/
4uzytki
/
ez-btm11.exe
/
EX0.BTM
< prev
next >
Wrap
Text File
|
1994-03-01
|
6KB
|
237 lines
: EX0.BTM
: A library of subprograms. Run with the name of any of the subprograms
: specified below + commands / options / switches. See EX-HLP.BTM (or
: type 'EX H option') for more details on each sub-program.
: (This file contains programs eliminated from EX.BTM. I've left, however,
: the HELP text about them in EX-HLP.BTM. They are left out because they
: can now be replaced by better batches.)
: Itamar Even-Zohar
: Porter Chair of Semiotics, Tel Aviv University
: Tel Aviv 69978, Israel
: itamarez@plato.tau.ac.il, or itiez@ccsg.tau.ac.il
:
if "%1" == "" goto CONTENTS
goto begin
:contents
cls
text
Usage: EX function [options]
where function stands for
help or h <command> .... Explanations on each of the following
up|upf|f <archive name>. Updates|Freshens specified zip on B:
sp|sf|op ............... Runs Norton's Speedisk (after unhiding all
descript.ion files, then hiding them again)
zp|zpx ..................Creates two sorts of ZIP archives on B: with path
names (ZP)|extracts these archives to disk (ZPX)
endtext
quit
:begin
if %1 == q quit
goto %1
quit
:HELP
:H
call EX-HLP %2
quit
:--------------------------------------------------Update/Freshen
:UP
:UPF
:F
: Updates (command: UP) or Freshens (command UPF or F) specified
: ZIP archive on drive B: (change to suit your preference above the ^^
: string below).
setlocal
set zipdisk=B
rem ^^ change to suit your preference
: ----> the following 2 variables are needed for running an extra
: procedure, explained below under label :updateMY.
set myzip=EZ
set myzipdir=c:\EZ
rem ^^^^^^^^ Change both parameters to suit yours.
alias quix `endlocal^quit`
alias ZU `pkzip -ub%_lastdisk %1& -ex`
alias ZF `pkzip -fb%_lastdisk %1& -ex`
if "%1"=="UP" set up=zu
if "%1"=="UPF" set up=zf
if "%1"=="F" set up=zf
shift
:begin2
if not "%1"=="" goto begin3
:filename!
echo.
text
SYNTAX:
EX UP|UPF|F archive_name [options]
(do not specify drive [default: B:], omit ZIP extension)
endtext
quix
:begin3
iff %@ready[%zipdisk:] eq 1 then
goto update
else
goto error2
endiff
:error2
cls
:error3
echo -- Insert diskette in drive %zipdisk: and
pause
goto begin3
:update
if %1==%myzip goto updateMY
inkey /K"YN" Currently working in %_cwd, is this OK? (Y/N) %%rep
iff %rep==N then^ input type desired directory: %%dir^
cdd %dir
endiff
iff not exist %zipdisk:%@upper[%1].ZIP then
echo %zipdisk:%@upper[%1].ZIP not found
quix
endiff
%up %zipdisk:%1& -x*.zip -x*.tmp -x*.bak
rem "zip", "tmp" and "bak" files are not to be compressed in the archive.
rem Change if your prefer otherwise.
quix
:-------------------------------------------------------Optimize
:SF
:OP
cls
:optimize
Iff %@eval[%@dosmem[k]] lt 600 then
cls
echo.
echo No memory for optimization (%@upper[%pgm] is loaded)
quit
else
goto do-optimize
endiff
iff %_dosver gt 6 then
goto do-optimize
else
goto norton
endiff
:do-optimize
::keystack 0 enter^defrag /H /F
keystack 0 enter^defrag /H /F /LCD
rem For notebook displays: ^^^^
goto end_op
:norton
setlocal
iff "%@search[sd.exe]" =="" .and. "%@search[speedisk.exe]" =="" then
echo.
echo You need Norton's SPEEDISK to run this sub-program
quit
endiff
iff "%@search[speedisk.exe]" =="" .and. not "%@search[sd.Exe]" =="" then
set sd=sd
else
set sd=speedisk
endiff
call ex ci-hide - descript.ion
keystack 0 enter^%sd /f
call ex ci-hide + descript.ion
endlocal
:end_op
cls
echo.
echo Disk successfully optimized
quit
:----------------------------------------Files to & from Zipfile
:zp
:zpx
: zipping & unzipping update archives
: ZP [switch] creates a ZIP archive from a file with a list of filenames
: called UPD.BAT. If you use switch H, the archive's name will
: be FROMHOME.ZIP; if you use switch F, the archive's name will
: be FRMOFICE.ZIP. The archives will be created on drive B:, or
: change above ^^ below.
: ZPX [switch] extracts the relevant archive to the respective
: subdirectories on your hard disk.
shift
setlocal
set zipdisk=B
rem ^^ change to suit your preference
if "%1"=="" goto syntaxz
goto check
:syntaxz
echo Type H for "fromhome", F for "frmofice"
inkey Type preferred option: %%1
:check
if %1==h goto home
if %1==f goto office
goto syntaxz
:home
iff "%0"=="zp" then
pkzip -ub%_lastdisk: -P %zipdisk:fromhome @upd.Bat
elseiff "%0"=="zpx" then
pushd c:\
pkunzip -n -d %zipdisk:fromhome.Zip
endiff
endlocal
quit
:office
iff "%0"=="zp" then
pkzip -ub%_lastdisk: -P %zipdisk:frmofice @upd.Bat
elseiff "%0"=="zpx" then
pushd c:\
pkunzip -n -d %zipdisk:frmofice.Zip
endiff
endlocal
quit
:---------------subroutines
:-------------------
:updateMY
rem This procedure takes care of a "default archive"
rem using default parameters (updating only files saved
rem since a specified date). I have left it here since
rem if you like this possibility, you can easily modify
rem the various parameters to suit your own files.
cls
echo.
echo --`>` Currently working in %_cwd but will switch temporarily to
echo %myzipdir, THEN RETURN
echo.
iff not "%_cwd"=="%myzipdir" then^CDD %myzipdir^endiff
iff not exist %zipdisk:%myzip.zip then^echo -- %zipdisk:%myzip.zip not found!^goto error3^endiff
echo.
echo ==`>` %@upper[%myzip.zip] will be updated for files since 1.1.1992.
%up -t010192 %zipdisk:%myzip -x*.zip -x*.tmp -x*.bak
rem ^^^^^^ ^^^^^ ^^^^^ ^^^^^
rem Change date and exception files to suit your needs!
rem "exception files" are files not to be compressed in the archive.
quix