Execute Process Task Using WinZip with a Variable

  • I am trying to execute WinZip via an Execute Process Task in SSIS which compresses assorted XML files which have been processed to this point.

    The SSIS package will run 2-5 times a day, so each time I zip up some files I need the filename to be unique to avoid overwriting an existing archive(zip file) that has already been created.

    I have a string variable called NewFileName which uses an expression to populate the value. The expression is a combination of other variables

    @[User::ArchiveFN] + @[User::SysDateTime] + ".zip"

    The ArchiveFN variable provides the first part of the zip filename while the SysDateTime provides the current date and execution start time of the SSIS package.

    Now for my question/issue. How would I use this NewFileName variable in my Execute Process Task to create a unique zip file?

    I have tried passing the variable along with *.xml within the Arguments field with no luck. I have also tried creating a complete string variable which included 'NewFileName.zip *.xml' as the StandardInputVariable with no success.

    If I simply pass 'test.zip *.xml' within the Arguments the task completes successfully.

    Any assistance would be appreciated. Thanks!

  • I have figured out how to pass the variable to the Execute Process Task via Expressions like I want to.

    The only thing I need to correct now is adding a space within my string variable.

    For example, testfileTODAYSDATE.zip_*.xml ( the _ should be a space). I am unable to include the space that is needed when I use a string variable.

    Currently the variable reads: testfileTODAYSDATE.zip*.xml which causes an error. For some reason a space can not be recognized.

    Does anyone have any ideas on how that can be accomplished? Any ideas or thoughts would be appreciated. Thanks!

  • ANSWER:

    Here is how I answered my own question.

    For starters, the Combo variable is needed. This includes the NewFileName I want to create as well as the files I want to zip up called XMLFiles. I set the Combo variable to be evaluated by an expression. The expression reads as follows:

    @[NewFileName] + " " + @[XMLFiles]

    Notice the " ", the space within the quotes adds the space between the variables.

    I then passed the variable to the Execute Process Task via the Expressions option as Arguments and it worked.

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

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