Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
msantosa
Starting Member
16 Posts |
Posted - 2007-03-14 : 11:33:36
|
Hi, I need to zipped files using SSIS, but not sure how to do that. Zip application: 7-zipAny help?thanks |
|
msantosa
Starting Member
16 Posts |
Posted - 2007-03-20 : 12:11:26
|
I got it working using Script Task Sub ZippedFiles(ByVal archivePath As String) Dim psi As New ProcessStartInfo Dim p As Process Dim ZipApplication As String Dim Argument As StringBuilder Try ZipApplication = "C:\Progra~1\7-Zip\7za.exe" Argument = New StringBuilder("" & ZipApplication & " a -tzip """ & archivePath & "report.zip""") Argument.Append(" """ & Now().ToString & "1.csv""") Argument.Append(" """ & Now().ToString & "2.csv""") psi.FileName = "cmd.exe" psi.Arguments = "/c " & Argument.ToString psi.RedirectStandardOutput = True psi.UseShellExecute = False p = Process.Start(psi) Catch ex As Exception Throw New ApplicationException("Error zipping", ex) End Try End Sub |
 |
|
|
|
|