Link to home
Start Free TrialLog in
Avatar of Auerelio Vasquez
Auerelio VasquezFlag for United States of America

asked on

Using SSIS Script Task to Check if a file exists (using C# scripting language)

i'm trying to use script task to check if a file exits. I've done this before, but it was using visual basic script. our packages are set up using C#.

this is what i have in vb (need to convert to c#)

Public Sub Main()

   Dts.Variables("v_bolFileExists").Value = File.Exists(Dts.Variables("v_zipFileArchived").Value)
'
   Dts.TaskResult = ScriptResults.Success

End Sub
Avatar of Jim Horn
Jim Horn
Flag of United States of America image

<not an answer, but I'll throw it out in case it helps>

Pragmatic Works has a suite of custom SSIS components called Task Factory, and the File Properties task will check to see if any path-file exists, and store the result in a variable for later use.   The license is about a grand per enviroment, but if you have multiple SSIS needs chances are this product meets a bunch of them.
ASKER CERTIFIED SOLUTION
Avatar of Brian Crowe
Brian Crowe
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial