Hi there,
I have a DTS package that I want to use to copy a file from one directory to another, and then rename it. I'm doing this using a
VB script within an ActiveX script task.
The problem is I don't know exactly what the name of the file I need to copy will be. I do know it will be of the format t****1p**.xml
I can copy all files of a particular file name format to another directory using this code within the script:
Function Main()
Set FSO = CreateObject("Scripting.FileSystemObject")
FSO.copyfile "c:\test\t*1p*.xml", "c:\results\"
Main = DTSTaskExecResult_Success
End Function
The problem here is that the file is copied with it's original file name, which is no good to me. If I try to specify the file name to copy to, ie:
FSO.copyfile "c:\test\t*1p*.xml", "c:\results\data.xml"
...it complains about an invalid path when I run the script.
I've also tried this:
Set FILE = FSO.GetFile("c:\test\t*p*.xml")
FILE.name = "data.xml"
But it won't let me reference the file without specifying it's exact file name.
Any help greatly appreciated!
Ta in advance,
Dan.