DistributeFile()

code

' -----------------------------------------------
' DistributeFile()
' Kopies a file from SRC to DST.
' -----------------------------------------------

Sub DistributeFile(strSRC, strDST)
on error resume next
Dim objFSO

Set objFSO = CreateObject("Scripting.FileSystemObject")
WScript.StdOut.Write "Copying " & strSRC & "..." & vbcrlf
objFSO.CopyFile strSRC, strDST, TRUE    'Copy with overwrite
If Err.Number <> 0 Then
WScript.Echo "Error distributing " & strDST & "!"
WScript.Echo "Error: " & Err.Description & "; Err#: " & Err.Number
End If
End Sub

example

If IfMember(objUser, "IBSE_Appl_Office_Templates") Then
strUserProfilePath = objWShell.ExpandEnvironmentStrings("%USERPROFILE%")
' --- BLANK.POT (PowerPoint)
If Not objFSO.FileExists(strUserProfilePath & "\Application Data\Microsoft\Templates\blank.pot") Then
DistributeFile "\\ribse011\apps\officetemplates\blank.pot", strUserProfilePath & "\Application Data\Microsoft\Templates\"
End If
End If

description

Distributes the source file to the destination path (simply copies the file :) ).
Overwrites if necessary.
Requires:  Source file and destination path.
Returns:  Nothing.