I need to copy a subset of files in a folder. The files to be copied share a common prefix iin the naming convention - date of the report + clientname + the generic name of the file. In dts I used to do it like this:
strSourcePath = "\\sourceServer\sourceFolder\"
strDestinationPath = "\\destinationServer\destinationFolder\"
set oFS = CreateObject("Scripting.FileSystemObject")
''Build File Name Extensions using the current date
AddYear = year(DTSGlobalVariables("StartDate").Value)
AddMonth = Month(DTSGlobalVariables("StartDate").Value)
AddName = trim(DTSGlobalVariables("CustomerName").Value)
AddDay = day(DTSGlobalVariables("StartDate").Value)
AddExtension = AddYear & AddMonth & AddDay & "_" & AddName
strSourcePath = strSourcePath & AddExtension
strSourcePath = strSourcePath & "_*.*"
oFS.CopyFile strSourcePath, strDestinationPath
Set oFS = Nothing
I'm having trouble in SSIS using the file system task copying a set of files. It seems to only work with using 1 file name as a source - I'm trying to do the *.* in the sourcevariable. I've seen examples using the script task to do something similar but when i tried that it also didn't like the *.* in File.Copy(strSourcePath, strDestinationPath).
I feel like this should be a fairly common task, but I'm missing something. Any suggestions?