December 3, 2010 at 9:49 am
I am using a Script Task to find out if a folder / file exists using:
Dim dir As New DirectoryInfo(Dts.Variables("strSourceDirectory").Value)
'Check the directory and sourcefile(s) exist
If Not dir.Exists Or Not File.Exists(Dts.Variables("strSourceFile").Value) Then
Dts.Variables("bolSourceFileExists").Value = False
Dts.Variables("strError").Value = "Source directory / file does not exist"
Dts.TaskResult = ScriptResults.Failure
Else
Dts.Variables("bolSourceFileExists").Value = True
Dts.TaskResult = ScriptResults.Success
End If
However, when I run it the Script Task box stays yellow, just seems to hang and doesn't carry on along the relevant precedence. If I add the Dts.TaskResult = ScriptResults.Success at the end as a test and remove both occurences from inside the loop it runs.
What am I missing?
December 5, 2010 at 3:37 pm
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply