Thanks to everyones help I got it working. I wanted to post it so that maybe it can help someone else.
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
Function WshPipe($ShellCMD, OPTIONAL $NoEcho)
Dim $WshShell, $oExec, $AllOutput, $Exit, $WshExitCode
$WshErrorMsg=""
$WshShell=CreateObject("WScript.Shell")
$oExec=$WshShell.Exec($ShellCMD)
While $Exit<>1
Dim $Output
Select
Case Not $oExec.StdOut.AtEndOfStream
$Output=$oExec.StdOut.ReadAll
Case Not $oExec.StdErr.AtEndOfStream
$Output=$oExec.StdErr.ReadAll
$WshErrorMsg = $Output
Case 1
$Output=-1
EndSelect
If $Output=-1
If $oExec.Status=1
$Exit=1
Endif
Else
If $NoEcho<>1
? $Output
Endif
$AllOutput = $AllOutput + $Output
Endif
Loop
$WshExitCode=$oExec.ExitCode
$WshPipe=split($AllOutput,chr(10))
Exit($WshExitCode)
EndFunction