Also check the syntax. compare these two:
Code:
break on
;
$basedir="c:\cli\Clients"
$filename=dir("$basedir\*")
$archdir="c:\zip\"

WHILE ($filename <> "") AND (@error = 0)
IF ($filename <> ".") AND ($filename <> "..") AND (GetFileAttr($basedir+"\"+$filename) & 16)
GOSUB "create_zip"
ENDIF
$filename=dir()
LOOP
EXIT

:create_zip
$cmd=" wzzip -a -ex -rp "
$cmd=$cmd+' "$basedir\'+LTRIM(RTRIM($filename))+'.zip" "$basedir\'+LTRIM(RTRIM($filename))+'" '
SHELL '%comspec% /c $cmd '

Syntax-corrected:
Code:
break on
;
$basedir="c:\cli\Clients"
$filename=dir("$basedir\*")
$archdir="c:\zip\"

WHILE $filename <> "" AND @error = 0
IF $filename <> "." AND $filename <> ".." AND GetFileAttr($basedir+"\"+$filename) & 16
GOSUB "create_zip"
ENDIF
$filename=dir()
LOOP
EXIT

:create_zip
$cmd=" wzzip -a -ex -rp "
$cmd=$cmd+' "$basedir\'+LTRIM(RTRIM($filename))+'.zip" "$basedir\'+LTRIM(RTRIM($filename))+'" '
SHELL '%comspec% /c $cmd '



Sidenote: gosub and etc is.. dangerous. I started out with using that as well, but there's better options.


Edited by Björn (2006-12-20 11:15 AM)
_________________________
as long as it works - why fix it?
If it doesn't work - kix-it!