Thank for the direction. This is what I have so far. I have also been using kixstrip to help me figure this out. The following is the script. It looks like there is just one error on line three?
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
Here are the results from kixstrip420.
?"----- start-"+@time+"-"+$_debug_name+"- @error @serror"?
?"- 1-"+@time+"-"+$_debug_name+"- @error @serror"? $directory='\\NAS1\DFS\SOFTWARE\APPLICATIONS\TEMPLATES'
?"- 2-"+@time+"-"+$_debug_name+"- @error @serror"? $destination='%appdata%\MICROSOFT\TEMPLATES'
?"- 3-"+@time+"-"+$_debug_name+"- @error @serror"? $templates=enumdir($'directory')
?"- 4-"+@time+"-"+$_debug_name+"- @error @serror"? FOR EACH $file IN $templates
?"- 5-"+@time+"-"+$_debug_name+"- @error @serror"? IF NOT EXIST('$destination\$file')
?"- 6-"+@time+"-"+$_debug_name+"- @error @serror"? COPY '$directory\$file' '$destination'
?"- 7-"+@time+"-"+$_debug_name+"- @error @serror"? ENDIF
?"- 8-"+@time+"-"+$_debug_name+"- @error @serror"?
?"- 9-"+@time+"-"+$_debug_name+"- @error @serror"? ;Function Enumdir('$serverfiles')
?"- 10-"+@time+"-"+$_debug_name+"- @error @serror"? ; if exist("$serverfiles")
?"- 11-"+@time+"-"+$_debug_name+"- @error @serror"? ; $E=WshPipe('%comspec% /c dir "$directory\$mask" /b $subdir',1)
?"- 12-"+@time+"-"+$_debug_name+"- @error @serror"? ; for $element = 0 to ubound($e)
?"- 13-"+@time+"-"+$_debug_name+"- @error @serror"? ; next
?"- 14-"+@time+"-"+$_debug_name+"- @error @serror"? ; $Enumdir=$e
?"- 15-"+@time+"-"+$_debug_name+"- @error @serror"? ; else
?"- 16-"+@time+"-"+$_debug_name+"- @error @serror"? ; exit 1
?"- 17-"+@time+"-"+$_debug_name+"- @error @serror"? ; endif
?"- 18-"+@time+"-"+$_debug_name+"- @error @serror"? ; endfunction
?"- 19-"+@time+"-"+$_debug_name+"- @error @serror"?
?"- 20-"+@time+"-"+$_debug_name+"- @error @serror"?
?"- 21-"+@time+"-"+$_debug_name+"- @error @serror"?
?"- 22-"+@time+"-"+$_debug_name+"- @error @serror"? FUNCTION Enumdir($directory, OPTIONAL $mask, OPTIONAL $subdir)
?"- 23-"+@time+"-"+$_debug_name+"- @error @serror"? IF $subdir $subdir='/s'
ENDIF
?"- 24-"+@time+"-"+$_debug_name+"- @error @serror"? IF exist("$directory")
?"- 25-"+@time+"-"+$_debug_name+"- @error @serror"? $e=WshPipe('%comspec% /c dir "$directory\$mask" /b $subdir',1)
?"- 26-"+@time+"-"+$_debug_name+"- @error @serror"? FOR $element = 0 TO ubound($e)
?"- 27-"+@time+"-"+$_debug_name+"- @error @serror"? $e[$element]=left($e[$element],len($e[$element])-1)
?"- 28-"+@time+"-"+$_debug_name+"- @error @serror"? NEXT
?"- 29-"+@time+"-"+$_debug_name+"- @error @serror"? $enumdir=$e
?"- 30-"+@time+"-"+$_debug_name+"- @error @serror"? ELSE
?"- 31-"+@time+"-"+$_debug_name+"- @error @serror"? EXIT 1
?"- 32-"+@time+"-"+$_debug_name+"- @error @serror"? ENDIF
?"- 33-"+@time+"-"+$_debug_name+"- @error @serror"? ENDFUNCTION
?"------- end-"+@time+"-"+$_debug_name+"- @error @serror"
? "-"
? "-"+LCASE(@day)+" "+@date+" "+@time+"- kixtart "+@kix+"/4.00e script ending"
IF (Val(substr(@kix,1,1)) >= 4)
IF (len(@scriptname) <> 0)
" ("+LCASE(@scriptname)+")"
ENDIF
ENDIF
? "-"
IF RedirectOutput("CON")
ENDIF
COLOR C+/N
?
? "Informative KIX "+@kix+":"+" debug info see "+CHR(34)+$_debug_file+CHR(34)
IF (Val(substr(@kix,1,1)) >= 4)
IF (len(@scriptname) <> 0)
" ("+LCASE(@scriptname)+")"
ENDIF
ENDIF
IF RedirectOutput($_debug_file)
ENDIF
;($begin)
;
; thu 06-mar-2003 15:45:20 (kix 4.20 vs 4.00e)
;
;Informative KIXSTRIP: input=33 output=33 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)
(MCA: edit code-tag)
[ 06. March 2003, 22:56: Message edited by: MCA ]