"Allan Mitchell" <allan@no-spam.sqldts.com> wrote in message
news:7oach1d4cgok148q40fuu6qd6u5d5l1301@4ax.com...
> You very nearly had it. Something like this should work
>
> For Each f in Fold.Files
> If f.Size = 0 THEN
> f.Delete
> End if
> Next
>
> Allan
> On Wed, 31 Aug 2005 15:59:39 -0600, "mitch" <mitch_001@REMOVEyahoo.com>
> wrote:
>
>>Allan,
>>
>>Yes...I want it to delete files that are 0 bytes so they do not get FTP'd
>>to
>>the remote server.
>>
>>Could you please show me an example of how the File object could be used?
>>
>>Thanks,
>>
>>Mitch
>>
>>
>>
>>"Allan Mitchell" <allan@no-spam.sqldts.com> wrote in message
>>news:if8ch1p6iurqqfcoc10lb2kl5bjbfiltmc@4ax.com...
>>> Are you asking how to check a file's size?
>>>
>>> The File object has a size property so as you loop over the files you
>>> check the size and
>>> delete as appropriate
>>>
>>> Allan
>>>
>>>
>>>
>>> On Wed, 31 Aug 2005 11:27:23 -0600, "mitch" <mitch_001@REMOVEyahoo.com>
>>> wrote:
>>>
>>>>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
>>>>
>>>
>>>
>>> Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
>>>
www.SQLDTS.com - The site for all your DTS needs.
>>>
www.SQLIS.com - You thought DTS was good. here we show you the new
>>> stuff.
>>>
www.konesans.com - Consultancy from the people who know
>>
>
>
> Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
>
www.SQLDTS.com - The site for all your DTS needs.
>
www.SQLIS.com - You thought DTS was good. here we show you the new stuff.
>
www.konesans.com - Consultancy from the people who know