Hi andreasfc,

I'm sorry, but you changed a LOT of the code. Here below is working code for your situation.

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

Copy this code into Word and then copy/paste into your text editor and save the file as a .kix file and it should work fine.