check for file existence in activex script

  • Can some one tell me how to check for the existance of the file in activeX script?

  • Function Main()

    Dim oFSO

    Dim sSourceFile

    Set oFSO = CreateObject("Scripting.FileSystemObject")

    sSourceFile = "C:\SourceFile.txt"

    ' Check if file exists to prevent error

    If oFSO.FileExists(sSourceFile) Then

    YourAction

    End If

    ' Clean Up

    Set oFSO = Nothing

    Main = DTSTaskExecResult_Success

    End Function

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply