Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Custom dos BAT commands from SSIS

Posted on 2009-04-20
3
Medium Priority
?
1,097 Views
Last Modified: 2013-11-10
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?

Thanks
Mike
0
Comment
Question by:mikegrad7
  • 2
3 Comments
 
LVL 30

Accepted Solution

by:
nmcdermaid earned 1000 total points
ID: 24191399
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.
0
 
LVL 1

Author Comment

by:mikegrad7
ID: 24193138
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?.
0
 
LVL 30

Expert Comment

by:nmcdermaid
ID: 24200198
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'
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a large data set and a SSIS package. How can I load this file in multi threading?
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Suggested Courses

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question