mike
mike

Reputation: 441

7-Zip throws an error in SSIS 2012

I have the following problem:

I use 7-Zip in my SSIS 2012 package.

So I created the Execute Process task and put there:

WorkingDirectory: C:\Program Files\7-Zip\ (it's correct, double checked it)

Executable: 7z.exe

Argumnets: e "C:\Data\B1\Arch.7z" -so > "C:\Data\B1\Arch.7z.dat"

It means that I want to put all unzipped data to the file (stdout) Arch.7z.dat.

When I run the package I got the following error: Cannot use absolute pathnames for this command This error is thrown by 7-Zip.

But when I run the same command from command line it work correctly:

C:\Program Files\7-Zip>7z.exe e "C:\Data\B1\Arch.7z" -so > "C:\Data\B1\Arch.7z.dat"

What is the problem there?

Thanks Mik

Upvotes: 1

Views: 7120

Answers (2)

John Mo
John Mo

Reputation: 1326

The -o switch specifies the output folder and has to be used in addition to specifying the path in the -so switch. Specifying only the -o switch without the full path in the -so redirect or only the full path in the redirect without the -o switch won't work as expected or at all.

It should look like this:

C:\Program Files\7-Zip>7z.exe e -oC:\Data\B1 C:\Data\B1\Arch.7z -so > C:\Data\B1\Arch.7z.dat

Upvotes: 1

Gowdhaman008
Gowdhaman008

Reputation: 1323

Try something as follows.

Executable  C:\Program Files\7-Zip\7z.exe
Arguments   e “C:\Data\B1\Arch.7z”
Working directory   <Path of your source file>

Take a look at the following example.

Example to Unzip using 7 Zip in SSIS

Hope this helps!

Upvotes: 0

Related Questions