I added the next as noted. Kixstrip says that there are no errors but I am still getting a line three error. Here is a copy of the code.

$directory='\\NAS1\DFS\SOFTWARE\APPLICATIONS\TEMPLATES'
$destination='%appdata%\MICROSOFT\TEMPLATES'
$templates=enumdir($'directory')
FOR EACH $file IN $templates
IF NOT Exist('$destination\$file')
COPY '$directory\$file' '$destination'
ENDIF
NEXT
FUNCTION enumdir($directory, OPTIONAL $mask, OPTIONAL $subdir)
IF $subdir $subdir='/s'
ENDIF
IF Exist("$directory")
$e=wshpipe('%comspec% /c dir "$directory\$mask" /b $subdir',1)
FOR $element = 0 TO UBound($e)
$e[$element]=Left($e[$element],Len($e[$element])-1)
NEXT
$enumdir=$e
ELSE
EXIT 1
ENDIF
ENDFUNCTION

This is the error I got

ERROR : invalid method/function call: missing comma!
Script: C:\DOCUME~1\user\Desktop\KIXTAR~1.2\KiX2001.420\file12.kix
Line : 3

this thing is driving me to drinking.