Any ideas on how to unzip a file using C# script task in SSIS using 7zip utility.... This is what I have tried so far.
static void Main(){
var vDirInfo = new DirectoryInfo(@"\\server001\IMPORT\BizGroup\Vendor\");
List<string> lstFilesToUnzip = new List<string>();
lstFilesToUnzip.Add("Test");
foreach (FileInfo vFileName in vDirInfo.GetFiles("*.zip"))
{
foreach (string vFileKey in lstFilesToUnzip)
{
if (vFileName.ToString().Contains(vFileKey))
{
ProcessStartInfo p = new ProcessStartInfo();
//p.FileName = @"C:\Program Files\7-zip\7z.exe";
p.FileName = @"C:\Program Files (x86)\7-Zip\7z.exe";
//p.Arguments = "e -tgzip " + "@" + vDirInfo + vFileName.Name + " -o " + "@" + vDirInfo;
//p.Arguments = "e " + vDirInfo + vFileName.Name + " -o " + vDirInfo;
p.Arguments = "e -tgzip " + "@" + vDirInfo + vFileName.Name + " -o " + "@" + vDirInfo;
p.WindowStyle = ProcessWindowStyle.Hidden;
Console.WriteLine(p.Arguments);
Process x = Process.Start(p);
//x.WaitForExit();
//Console.WriteLine("Success");
;
}
}