In SSIS we don't have a task to zip the file/files, so we need to find a way to achieve this. In this post i am going to use "WinRAR" to zip the file/files with password protection.
Note: Make sure WinRAR is installed
Executable:
Note: Make sure WinRAR is installed
- In control flow drag and drop "Execute Process Task" from tool box.
- Edit the task and enter the "Executable, Arguments and WorkingDirectory" details (follow the below sample code)
Zip multiple files:
WinRAR.exe file path (where the WinRAR is installed).
Default path "C:\Program Files\WinRAR\WinRAR.exe"
Arguments:
-pTest123 A Kiran *.txt
-pTest123 A Kiran *.txt
-pTest123 : -p<Password>
A Kiran : A<Space><Desired zip file name>
*.txt : <Star (*) represents any file name><Dot(.)><After dot(.) txt represents file type>
WorkingDirectory:
Give the source file path (the files which we are going to zip)
Sample Path: D:\Kiran\SSIS\Sample\
Zip single files:
Follow the above steps and change the Arguments as mentioned below.
-pTest123 A Kiran TestFile.txt
-pTest123 : -p<Password>
A Kiran : A<Space><Desired zip file name>
No comments:
Post a Comment