SSIS

How to compress the files of a folder using winrar in SSIS package

In this post i will discuss about how to compress the files of a folder using winrar in SSIS package . But you can apply the same guidelines to compress the files of a folder with other softwares like winzip or 7-zip.

In the image below i have a folder abc in d:\ drive. There are few contents into it. I want to compress this folder using winrar.

 

compress the files of a folder using SSIS package winrar

 

In SSDT/BIDS*, drag and drop Execute Process Task control on Control Flow tab from the SSIS Toolbox, double click on the Execute Process Task control and go to the Process option under Execute Process Task Editor as shown below.Then click the ellipses button of the Executable property as shown below.

 

compress the files of a folder using SSIS package winrar

 

Browse the folder location where the executable file or .exe file of winrar is present as shown below.

 

compress the files of a folder using SSIS package winrar

 

Write the command line arguments for winrar as shown below in the Argument property of Execute Process Task. These arguments will compress all the contents of the folder using winrar present in D:\abc and store it in the rar format at D:\abc.rar.

 

compress the files of a folder using SSIS package winrar

 

Click Ok and execute the package and then go to D:\ and there abc.rar file has been created as shown below.

 

compress the files of a folder using SSIS package winrar

 

Now question arises how did i come to know about the command line arguments and what will be the command line arguments if i want to compress the folder using WinZip or 7-Zip?

In that case you can search “command line arguments for winrar or winzip or 7-zip” on Google as shown below.

 

compress the files of a folder using SSIS package winrar

 

 

So by changing the arguments you can compress as well as uncompress the files of a folder by any compression software like winrar or winzip or 7-zip .

 

Leave a Reply