Dear,

We have made some modification to LLigetfa example.
We are using the command line version of PKZIP.
Also we are using "-ex" (best compression), "-r" (included also subdirectories)
and "-p" (included also pathnames).

code:

break on
$pkzip_mode="add" ; "move"
;
$basedir="c:\windows"
$filename=Dir("$basedir")
WHILE ($filename <> "") AND (@error = 0)
IF ($filename <> ".") AND ($filename <> "..") AND (GetFileAttr($basedir+"\"+$filename) & 16)
; ? $basedir+"\"+$filename
GOSUB create_zip
ENDIF
$filename=Dir()
LOOP
EXIT
:create_zip
IF ($pkzip_mode = "add")
$cmd=" pkzip -a -ex -r -p "
ELSE
$cmd=" pkzip -m -ex -r -p "
ENDIF
$cmd=$cmd+' "$basedir'+'\'+LTRIM(RTRIM($filename))+'.zip" "$basedir'+'\'+'$filename'+'\*.*" '
; SHELL '%comspec% /c $cmd' ; <++++++++++
? $cmd
RETURN


An output example can be:
code:

pkzip -a -ex -r -p "c:\windows\INF.zip" "c:\windows\INF\*.*"
pkzip -a -ex -r -p "c:\windows\SYSTEM.zip" "c:\windows\SYSTEM\*.*"
pkzip -a -ex -r -p "c:\windows\COMMAND.zip" "c:\windows\COMMAND\*.*"
pkzip -a -ex -r -p "c:\windows\HELP.zip" "c:\windows\HELP\*.*"
pkzip -a -ex -r -p "c:\windows\FONTS.zip" "c:\windows\FONTS\*.*"
pkzip -a -ex -r -p "c:\windows\SendTo.zip" "c:\windows\SendTo\*.*"
pkzip -a -ex -r -p "c:\windows\WANGSAMP.zip" "c:\windows\WANGSAMP\*.*"
pkzip -a -ex -r -p "c:\windows\DESKTOP.zip" "c:\windows\DESKTOP\*.*"
pkzip -a -ex -r -p "c:\windows\JAVA.zip" "c:\windows\JAVA\*.*"
pkzip -a -ex -r -p "c:\windows\CONFIG.zip" "c:\windows\CONFIG\*.*"
pkzip -a -ex -r -p "c:\windows\MEDIA.zip" "c:\windows\MEDIA\*.*"
pkzip -a -ex -r -p "c:\windows\CURSORS.zip" "c:\windows\CURSORS\*.*"
pkzip -a -ex -r -p "c:\windows\TEMP.zip" "c:\windows\TEMP\*.*"
pkzip -a -ex -r -p "c:\windows\SYSBCKUP.zip" "c:\windows\SYSBCKUP\*.*"
pkzip -a -ex -r -p "c:\windows\spool.zip" "c:\windows\spool\*.*"
pkzip -a -ex -r -p "c:\windows\History.zip" "c:\windows\History\*.*"
pkzip -a -ex -r -p "c:\windows\Temporary Internet Files.zip" "c:\windows\Temporary Internet Files\*.*"

We have comment the SHELL call to prevent an unexpected result during
a test run. Please modify it and remove ";" symbol.
greetings.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA