#37476 - 2003-03-07 03:32 AM
Re: template files
|
ShaneEP
MM club member
   
Registered: 2002-11-29
Posts: 2127
Loc: Tulsa, OK
|
Until you have the time or willingness to learn how to use UDFs it may be easier for you to do something like what Jens suggested above. Just change the below code to match your server and share. Can add any other files by adding them to the $a list. This should work for you aslong as you dont have more than one source or destination.
code:
If Ingroup ("CINEVERYONE") $source='\\server\share\TEMPLATES\' $destination='%appdata%\MICROSOFT\TEMPLATES\'
$a='1CN_ENVBLANK.DOT','1CN_ENVELOPE.DOT'
for each $file in $a if not exist($destination+$file) ? "Copying "+$file copy $source+$file $destination else ? $file+" already exists" endif next Endif
[ 07. March 2003, 03:33: Message edited by: CitrixMan ]
|
|
Top
|
|
|
|
#37477 - 2003-03-07 03:38 AM
Re: template files
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
or just use xcopy /d /q /y
|
|
Top
|
|
|
|
#37478 - 2003-03-07 04:12 AM
Re: template files
|
howyadoing
Getting the hang of it
Registered: 2002-06-01
Posts: 86
Loc: Cincinnati
|
I cant believe I had the typo twice. Thanks again for you help. I am new to this and want to learn. So far I us kixtart for simple but long login script but I need to learn udf stuff. Any suggestions on some detailed docs to read?
|
|
Top
|
|
|
|
#37480 - 2003-03-07 04:18 AM
Re: template files
|
Radimus
Moderator
   
Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
|
I'd suggest going through the manual and the FAQ forum. The FAQ was developed by a number of the long term members of this board specifically to answer questions that are posted here repeatedly.
|
|
Top
|
|
|
|
#37482 - 2003-03-07 04:07 PM
Re: template files
|
howyadoing
Getting the hang of it
Registered: 2002-06-01
Posts: 86
Loc: Cincinnati
|
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
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1188 anonymous users online.
|
|
|