July 30, 2018 at 9:02 am
Hello everyone
I have a system task that attempts to copy files from one directory to another directory
the pb is that my script is out in error if it does not find one of my file
while I want my script to continue processing file copying even if there are non-existent files
Who can help me on this need please
Dts.TaskResult = (int)ScriptResults.Success;
String Filepath = Dts.Variables["User::name"].Value.ToString();
if (
File.Exists(Filepath))
{
Dts.Variables["User::File_exist"].Value = 1;
Dts.TaskResult = (int)ScriptResults.Success;
July 30, 2018 at 9:11 am
My French is not good enough to enable me to understand exactly what the problem is here.
Assuming you have a list of files held somewhere, a simple script task should do the job. IN pseudo code:
foreach (file in list)
{
if (File.Exists(sourceFilePath))
{File.Copy(sourceFilePath,targetFilePath);}
}
July 31, 2018 at 2:28 am
Sorry I did not manage to do it
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy