Monday 10 July 2017

SSIS: Zip the files with Password Protection

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

  • 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:

Executable: 
WinRAR.exe file path (where the WinRAR is installed). 
Default path "C:\Program Files\WinRAR\WinRAR.exe"

Arguments:
-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>
*.txt            : <FileName><Dot(.)><Extension>

See Alos:
Unzip a Password Protected Zip File

No comments:

Post a Comment