Using variables in execute process task

  • I am trying to understand this. I have made an execute process task to unzip some of the files with .rar extension. I am specifying the file name and output folder in the command line argument section and it works pretty fine.

    Now, if I want to put it in For each loop container and pass the variable which I obtained from container to the execute process then how can I pass it? I have tried replacing filename with the variable name which does not work. Do I have to specify it at a different place or differently?

  • Can you explain in slightly greater detail what you are doing in the package? SSIS is harder to debug since it is difficult to post graphic images to show what one is doing.

  • Well, I have first tested extracting one file with Winrar using SSIS. For that I had specified command line arguments like this

    e-- Which says extract would be the action

    C:\Filename.rar---- File to be axtracted

    C:\OutputFolder------ The folder where the extracted files will be landed.

    Now, I want to replace absolute address of the file with a Foreach loop variable since I want all the WinRar files in that folder to be extracted. I have defined the variable with for each loop but I to fit it in argument is what I am strggling to comprehend. i am not getting proper syntax for that.

  • You can't reference the variable directly but you can use expressions to set it..

    CEWII

  • I tried doing it with expression and I saw couple of the things are happeinng.

    I have specified variable in For each loop file enumerator. Then came back to execute task and did set expression with Arguments= User:: variable.

    Now, argument field is blank and I am manually writting something like this:

    e @[user:: variable] C:\Output

    Now I ran the package and it actually opens the files in that folder with Winrar. But does not AUTOMATICALLY extract it as it was doing when I was specifying absolute address. after I stop debugging and try to edit execute task again then the argument field goes blank and I have to type every thing.

    Something fishy........

  • I think the problem with the variable binding because when I actually say arguments= User:: variable then it just takes that address of the folder in the argument field and thats the sole value with which it is binding the

    whole argument field so It is not taking "e" as in extract as and extra command line parameter.

  • I think the problem with the variable binding because when I actually say arguments= User:: variable then it just takes that address of the folder in the argument field and thats the sole value with which it is binding the

    whole argument field so It is not taking "e" as in extract as and extra command line parameter.

  • Can you post the exact syntax of your expression field - sounds like it may need a tweak.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

Viewing 8 posts - 1 through 7 (of 7 total)

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