home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Plex 4
/
Plex4.mdf
/
english
/
wksliste.cmd
< prev
Wrap
OS/2 REXX Batch file
|
1994-10-23
|
3KB
|
105 lines
/*
WKSLISTE.CMD (ENGLISH !)
REXX-Program for viewing files
The viewer is selected from the following database by the
extension of the file to view.
***************************************************************
* The list of used view-programs can bei edited and extended *
* with any normal text-editor. For every extension there has *
* to be a specific view-program. It is important to change the*
* total number of viewers/extension in this line: *
* Extension.0 = 14 *
***************************************************************
* Modus /U "UNZIP" : The file is still in a ZIP. First unzip it.
and view it afdterwards.
%2 = d:\path\unzip.exe The UNZIP-Program
%3 = d:\path\archive.zip The ZIP-Archive
%4 = path/path/filename.ext The file to be unzipped and viewed (with PATH)
%5 = d:\temppath\WKS0001.TMP The TEMPPath-Filename-destination
* Modus /L "LIST" : File is already expanded. List it directly !
%1 = d:\path\filename.ext
(C) 1994 Wolfram Körner, Friedenstraße 5a, 97072 Würzburg.
*/
call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
call SysLoadFuncs
parse arg cmdline /* Get commandline parameters */
parse var cmdline Mode cmdline /* which mode ? /U or /L */
Mode = TRANSLATE(Mode)
if Mode = "/U" then do
parse var cmdline UnzipExe ZIP ZIPFile TEMPFile Rest /* analyze */
end
if Mode = "/L" then do
parse var cmdline TEMPFile Rest /* anylyze */
ZIPFile=TEMPFile
end
/* ------ The list of extensions and the correct viewers ----------*/
Viewer = "e.exe" /* This is the DEFAULT-viewer */
Extension.0 = 14 /* Size of the following list*/
Extension.1=".INF" /* *.INF should be viewed with VIEW.EXE */
Lister.1= "view.exe"
Extension.2=".ICO" /* *.ICO should be viewed with ICONEDIT.EXE */
Lister.2= "iconedit.exe"
Extension.3=".BMP" /* and-so-on....... */
Lister.3= "iconedit.exe"
Extension.4=".MID"
Lister.4= "mppm.exe"
Extension.5=".WAV"
Lister.5= "mppm.exe"
Extension.6=".AVI"
Lister.6= "mppm.exe"
Extension.7=".MET"
Lister.7= "picview.exe"
Extension.8=".PIF"
Lister.8= "picview.exe"
Extension.9=".SPL"
Lister.9= "picview.exe"
Extension.10=".MOD"
Lister.10= "dmplayer"
Extension.11=".GIF"
Lister.11= "pmjpeg"
Extension.12=".PCX"
Lister.12= "pmjpeg"
Extension.13=".TIF"
Lister.13= "pmjpeg"
Extension.14=".JPG"
Lister.14= "pmjpeg"
/* -------------- Get file from ZIP-archive (Modus /U )----------- */
/* UNZIP-Options:
-j "Junk Pathnames"
-o "overwrite"
-p "extract to pipe"
*/
if Mode = "/U" then
UnzipExe "-pjo" ZIP ZIPFile " > " TEMPFile
/* -------------- Searchroutine for the correct viewer ---------------- */
ZIPFile = Translate(ZIPFile) /* Change to UPPERCASE */
do i=1 to Extension.0
if Extension.i = right(ZIPFile, 4) then
Viewer=Lister.i
end /* do */
/* --------------- Call the correct viewer with the file -------------- */
'start /f' Viewer TEMPFile