Function Main()
Dim oFSO
Dim vSourceFile
Dim vDestinationFile
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Const OverwriteExisting = True
Const DeleteReadOnly = True
vSourceFile = "\\MySourceDirectory\*.csv"
vDestinationFile = "\\MyDestinationDirectory\"
' Move the files Use OverwriteExisting in case the file is there
objFSO.CopyFile vSourceFile, vDestinationFile, OverwriteExisting
' Delete the files in the source directory
objFSO.DeleteFile(vSourceFile ) , DeleteReadOnly
Set oFSO = Nothing
Main = DTSTaskExecResult_Success
End Function
Now, all of the files in the source directory are now in the archive.
No comments:
Post a Comment