home *** CD-ROM | disk | FTP | other *** search
- :*******************************************************************************
- : A 4LOGIC bathc utility A Free program. All of the code here is released
- : to the public domain.
- : Name: 4LVCPROC.btm v.1.0
- :
- : Author: Brad Owen
- :
- : Description: 4LVC module to pre-process input prior to calling another module
- :
- : ** This program cannot be run standalone **
- : ** It can only be called by 4LVC **
- :
- :*******************************************************************************
- @echo off
-
- iff %_batch == 1 then
- cls
- beep 400 2 350 2 400 2 350 2 400 2 350 2
- echo.
- echo 4LVCPROC error: This program cannot be run standalone.
- quit
- endiff
-
- set LVCRESP=
- set LVCFMT=
- set LVCOK=
- cls
-
- @md %_cwd\4lvc-wrk >&! NUL
- @del /qy %_cwd\4Lvc-wrk\*.* >&! NUL
-
- :TESTPARMS
-
- if "%1"=="" goto WRAPUP
- set PWORD=
- set ARCHPASS=
- set NOPASS=
-
- iff "%1"=="4lvc-*.zip" then
- set pword=
- set nopass=%1
- set LVCFMT=EXT
- goto PROCESSING
- endiff
-
- iff exist 4lvcp%1.zip .OR. exist 4lvc-%1.zip then
- iff exist 4lvcp%1.zip then
- set pword=
- set archpass=4lvcp%1.zip
- endiff
-
- iff exist 4lvc-%1.zip then
- set nopass=4lvc-%1.zip
- endiff
-
- set LVCFMT=EXT
- goto PROCESSING
- endiff
-
- iff exist 4lvcp%@ext[%1].zip .OR. exist 4lvc-%@ext[%1].zip then
- iff exist 4lvcp%@ext[%1].zip then
- set pword=
- set archpass=4lvcp%@ext[%1].zip
- endiff
- iff exist 4lvc-%@ext[%1].zip then
- set nopass=4lvc-%@ext[%1].zip
- endiff
- set LVCFMT=FIL
-
- goto PROCESSING
- endiff
-
- shift
- goto TESTPARMS
- :*******************************************************************************
- : Routine to get password
-
- :GET_PASS
- cls
- drawbox 0 0 10 79 0 whi on cya fill blu
- scrput 2 32 gre on blu %ARCHPASS
- scrput 3 25 bri yel on blu is a password protected file.
- scrput 4 21 bri yel on blu You must enter the correct password
- scrput 5 18 bri yel on blu in order to process files in this archive.
- scrput 8 32 bri yel on blu [ ]
- screen 8 33
- input %%pword
- iff "%pword" == "" then
- cls
- beep 400 2 350 2 400 2 350 2 400 2 350 2
- echo 4LVC error: You MUST enter a password to
- echo process files in this archive.
- pause
- goto GET_PASS
- endiff
-
- pkunzip -t -s%pword %ARCHPASS > passtest.0
-
- set ptest=%@line[passtest.0,%@lines[passtest.0]]
- iff "%ptest"== "PKUNZIP: No file(s) found." then
- cls
- beep 400 2 350 2 400 2 350 2 400 2 350 2
- echo 4LVCPROC error: The password you entered: %pword
- echo is incorrect
- pause Press a key to return to Main Menu...
- del /q 4LVC.0 >& NUL
- del /q 4LVC.1 >& NUL
- del /q /y %_cwd\4lvc-wrk\*.* >& NUL
- rd %_cwd\4lvc-wrk >& NUL
- del /q passtest.0
- set LVCRESP=
- set LVCVER=
- set LVCNAM=
- set ARCHDESC=
- set LVCRC=
- set pword=
- set ptest=
- quit
- endiff
- del /q passtest.0
- return
-
- : End of password routine
- :*******************************************************************************
-
- :*******************************************************************************
- : Begin processing routines
-
- :PROCESSING
-
-
-
- iff "%LVCFMT" EQ "FIL" then
- if "%archpass" NE "" for %%Z in (%archpass) do gosub LOOP
- if "%nopass" NE "" for %%Z in (%nopass) do gosub LOOP
- endiff
-
-
-
- iff "%LVCFMT" EQ "EXT" then
- if "%archpass" NE "" for %%Z in (%archpass) do gosub LOOP
- if "%nopass" NE "" for %%Z in (%nopass) do gosub LOOP
- endiff
-
-
- shift
- set LVCFMT=
- goto TESTPARMS
-
- :WRAPUP
- iff "%LVCOK" EQ "" then
- cls
- beep 400 2 350 2 400 2 350 2 400 2 350 2
- echo 4LVCPROC: No archive files found with extensions provided.
- pause Press a key to continue...
- endiff
- set LVCOK=
- @del /qy %_cwd\4Lvc-wrk\*.* >&! NUL
- rd %_cwd\4Lvc-wrk >&! NUL
- cls
- quit
-
- :LOOP
- cls
- set LVCOK=X
- echos Processing archive file %@upper[%Z]. Please wait a moment...
- iff "%LVCFMT" EQ "FIL" then
- iff "%archpass" NE "" then
- gosub GET_PASS
- endiff
- PKZIP -q-vcbrd %Z %@name[%1].* >&! %_cwd\4Lvc-wrk\4LVCXTRC.0
- else
- iff "%archpass" NE "" then
- gosub GET_PASS
- endiff
- PKZIP -q-vcbrd %Z >&! %_cwd\4Lvc-wrk\4LVCXTRC.0
- endiff
-
- set LVCRCD=8
- set LVCEND=%@lines[%_cwd\4LVC-wrk\4LVCXTRC.0]
- gosub LOOPTOP
- return
-
- :LOOPTOP
- if %LVCRCD GT %LVCEND goto LOOPEND
- if "%@substr[%@line[%_cwd\4Lvc-wrk\4LVCXTRC.0,%LVCRCD],1,6]" EQ "------" goto LOOPIN
-
- :LOOPOUT
- set LVCRCD=%@eval[%LVCRCD + 1]
- goto LOOPTOP
-
- :LOOPIN
- set LVCRCD=%@eval[%LVCRCD + 1]
- if "%@substr[%@line[%_cwd\4Lvc-wrk\4LVCXTRC.0,%LVCRCD],1,6]" EQ "------" goto LOOPOUT
- set LVCNAM=%@substr[%@line[%_cwd\4Lvc-wrk\4LVCXTRC.0,%LVCRCD],46,12]
- set LVCRCD=%@eval[%LVCRCD + 1]
- set LVCCOM=%@substr["%@line[%_cwd\4Lvc-wrk\4LVCXTRC.0,%LVCRCD] ",10,41]
- echo %Z >&! %_cwd\4Lvc-wrk\%LVCNAM
- describe %_cwd\4Lvc-wrk\%LVCNAM "%LVCCOM"
- set LVCCOM=
- set LVCNAM=
- goto LOOPIN
-
- :LOOPEND
- set LVCRCD=
- set LVCEND=
- del /q %_cwd\4Lvc-wrk\4LVCXTRC.0 >&! NUL
- iff exist %_cwd\4Lvc-wrk\DESCRIPT.ION then
- iff "%PROCEDURE"=="GETSOME" then
- keystack !
- select /A-d-h call 4LVCXTR (%_cwd\4Lvc-wrk\*.*)
- keystack 00
- else
- keystack !
- select /A-d-h call 4LVCDLT (%_cwd\4Lvc-wrk\*.*)
- keystack 00
- endiff
- else
- drawbox 1 0 13 79 0 whi on cya fill blu
- iff "%LVCFMT" EQ "FIL" then
- scrput 3 12 yel on blu No files found in archive %@upper[%Z] which match your request:
- scrput 4 20 gre on blu %@upper[%@name[%1]].000 thru %@upper[%@name[%1]].999
- scrput 5 12 yel on blu If you think this is an error, try running
- scrput 6 20 gre on blu PKZIP -q-vcbrd %@upper[%Z] %@upper[%@name[%1]].*
- scrput 7 12 yel on blu manually from the command line.
- else
- scrput 4 12 yel on blu No files at all found in archive %@upper[%Z].
- scrput 5 12 yel on blu If you think this is an error, try running
- scrput 6 20 gre on blu PKZIP -q-vcbrd %@upper[%Z]
- scrput 7 12 yel on blu manually from the command line.
- endiff
- scrput 9 5 yel on blu If there are files present, then there is some problem writing to your
- scrput 10 5 yel on blu disk (password/write protection, not enough space, etc.). Resolve the
- scrput 11 5 yel on blu problem and try again. Press a key to continue.
- inkey /W180 %%LVCRESP
- set LVCRESP=
- cls
- endiff
- del /qy %_cwd\4Lvc-wrk\*.* >&! NUL
- return
-