SSIS problem creating multiline DOS batch file


I have to create a multiline DOS batch file in SSIS that looks like this:

cd e:\client\data
copy generic_output.txt clientname.yyyymmdd (yyyymmdd is today's date)

I have created quite a few single line DOS copy statements that do the copy (using a Derived column in the Data Flow) but can't come up with an approach that will allow me to create a template file that contains the (hardcoded) first line and then have a Data Flow task that writes out the first line and then have the Derived column be the second line.

Can I write out both commands in the Derived Column and put in a CR-LF in between the cd command and the copy command? Or is there a better approach?


Dick RosenbergAsked:
Who is Participating?
Dick RosenbergAuthor Commented:

I figured out a way that works. The cd command is fixed so I put that into a file. Then I used a Data Flow to build the COPY command in another file. Then I set up a copy.bat file to copy the 2 files, and then finally an Execute Process task to execute the final batch file. It works.


Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.