Custom dos BAT commands from SSIS

I have a need to run some custom DOS commands from an SSIS package. Normally I would use a .BAT file and just use the Execute process task. However this time I need to make these calls programmaticly - the parameters are changing, as well as a decryption key must be used that cant be in plain text.

i needto make two calls - one to GZIP to unzip a file and another to decrypt a file, for example

decrypt.exe -1 -2 -key "AbC$%{" FileName.enc Filename.Clear.gz
gzip Filename.Clear.gz Filename.Clear

The changing parameters here are the key and the filename - I would like to be ablke to specify these as SSIS package variables.. Can the script task in SSIS do something like a shell out to the OS, or is there a better way to handle this?

Who is Participating?
nmcdermaidConnect With a Mentor Commented:
You can build your command line dynamically using an expression.
1. Open the property page for the Execute Process Task
2. Press the 'browse' button on Expressions property
3. Pick the Executable property
4. Enter or build an expression. This will be evaluated at run time and will replace the Executable property within the task.
Post back with some more details on your variables and how they fit together and I can help you build an expression.
mikegrad7Author Commented:
Thanks nmcdermaid, i completey forgot about expressions - i hadn't tried that.  Can i put the whole expression, arguments and all, in the executable property, or do i still have to split it up and put the exe in the executable property and the arguments in the arguments property?.
I assume you can just put it all in the executable property. When you run it in DOS, its all on one line concatenated line. I think the arguments property is just an optional extra to make it 'neater'
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.