Tuesday 11 July 2017

SSIS: Unzip a Password Protected zip file

In SSIS we don't have a task to Unzip the zipped file,  so we need to find a way to achieve this. In this post i am going to use "WinRAR" to Unzip the zipped file which is password protected.

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:
e -o+ -pTest123 "D:\Kiran\SSIS\Sample\Kiran.rar"

e -o+ -pTest123                               : e<Space>-o+<Space>-p<Password>
"D:\Kiran\SSIS\Sample\Kiran.rar" : "<Zip file path with extension>"

WorkingDirectory:
Give the Target file path (the unzipped files will store in this location)

Sample Path: D:\Kiran\SSIS\Sample\




See Also:
Zip the file/files with password protection

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