Hi,
The following code works perfectly but now I want to do a little tweak at a different part of the DTS package. What I want to do is to delete files that are blank so they are not FTP'd to the remote server (a zero byte TXT file). I can see in my head what I need to do to the code, but I cannot figure it out. It seems like I would have to add some type of IF statement?
This is the code that runs after the FTP part so the files do not get sent again:
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Function Main()
Dim objFSO
Dim objFolder
Dim objFile
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("C:\Websites\LocalUser\web-forms\aio\")
For Each objFile In objFolder.Files
objFile.Delete True
Next
Set objFile = Nothing
Set objFolder = Nothing
Set objFSO = Nothing
Main = DTSTaskExecResult_Success
End Function
Any help would be greatly appreciated.
Thanks!
Mitch
The following code works perfectly but now I want to do a little tweak at a different part of the DTS package. What I want to do is to delete files that are blank so they are not FTP'd to the remote server (a zero byte TXT file). I can see in my head what I need to do to the code, but I cannot figure it out. It seems like I would have to add some type of IF statement?
This is the code that runs after the FTP part so the files do not get sent again:
'**********************************************************************
' Visual Basic ActiveX Script
'************************************************************************
Function Main()
Dim objFSO
Dim objFolder
Dim objFile
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFSO.GetFolder("C:\Websites\LocalUser\web-forms\aio\")
For Each objFile In objFolder.Files
objFile.Delete True
Next
Set objFile = Nothing
Set objFolder = Nothing
Set objFSO = Nothing
Main = DTSTaskExecResult_Success
End Function
Any help would be greatly appreciated.
Thanks!
Mitch