Dear,
With kixstrip we solve your problem.
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
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
After the call kixstrip input.kix output.kix /block_check
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
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
;($begin)
;
; thu 06-mar-2003 23:06:29 (kix 4.20 vs 4.00e)
;
;Informative KIXSTRIP: input=20 output=20 skip=0
;
;Warning KIXSTRIP: 1 error in block structure. missing statement(s).
; - do:until [0:0]
; -ERROR- - for|each:in|to:step|next [2|1:1|1:0|1]
; - function:endfunction [1:1]
; - if:else:endif [3:1:3]
; - select:case:endselect [0:0:0]
; - while:loop [0:0]
;Warning KIXSTRIP: some lines contains errors or possible errors.
;Informative KIXSTRIP: 6 block_structures found.
;Informative KIXSTRIP: 1 UDF found.
;Informative KIXSTRIP: no labels found.
;Summary KIXSTRIP: BREAK CALL DEBUG DISPLAY ENDFUNCTION EXECUTE EXIT FUNCTION GET GETS GOSUB GOTO OLExxx PLAY QUIT RETURN RUN SHELL SLEEP THEN USE
;Informative KIXSTRIP: 1 ENDFUNCTION
;Informative KIXSTRIP: 1 EXIT
;Informative KIXSTRIP: 1 FUNCTION
;
;($end)
;($begin)
;
;
;($end)
After inserting missing NEXT statement and doing the call kixstrip input.kix output.kix /block_check
we get
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
;($begin)
;
; thu 06-mar-2003 23:08:12 (kix 4.20 vs 4.00e)
;
;Informative KIXSTRIP: no errors found (input=21 output=21 skip=0).
;
;Summary KIXSTRIP: block structures
; - do:until [0:0]
; - for|each:in|to:step|next [2|1:1|1:0|2]
; - function:endfunction [1:1]
; - if:else:endif [3:1:3]
; - select:case:endselect [0:0:0]
; - while:loop [0:0]
;Informative KIXSTRIP: 6 block_structures found.
;Informative KIXSTRIP: 1 UDF found.
;Informative KIXSTRIP: no labels found.
;Summary KIXSTRIP: BREAK CALL DEBUG DISPLAY ENDFUNCTION EXECUTE EXIT FUNCTION GET GETS GOSUB GOTO OLExxx PLAY QUIT RETURN RUN SHELL SLEEP THEN USE
;Informative KIXSTRIP: 1 ENDFUNCTION
;Informative KIXSTRIP: 1 EXIT
;Informative KIXSTRIP: 1 FUNCTION
;
;($end)
greetings.
btw: don't forget to read our kixstrip.pdf document, which you can find
on our site. Page
"Summary of Site" or "Home - Kix Tools".