December 3, 2008 at 1:00 pm
Hi iam facing a problem in unzipping a file.I am using process task .I dont know how to pass a command line.
Here is the .exe file location C:\Program Files (x86)\WinZip\WINZIP32.EXE
I zip life location is U:\InformationTechnology\Datawarehouse\prod_20081126.zip
Please help me in writing a command line for unzipping
Thanks
Raghu
December 3, 2008 at 8:01 pm
First, you can't do this with the Winzip GUI. You need an add-on to Winzip (available for download on their website) to install the command line tools. You must have the commercial version of Winzip to do this; you can't use the command line add-on with the free trial version.
Once you've got this installed, you'll need a different executable - I believe it's wzzip.exe (check the documentation to be sure). If you call that executable with no parameters, it will open the Help file and guide you through the syntax.
hth,
Tim
Tim Mitchell, Microsoft Data Platform MVP
Data Warehouse and ETL Consultant
TimMitchell.net | @Tim_Mitchell | Tyleris.com
ETL Best Practices
December 4, 2008 at 6:45 am
Thank you very much for your answer...........Is there any other way i can open the zip using ny ssis task......I have tried using with scrit task but......iam not getting the correct code.........If you have any idea regarding that please post it
Thanks in advance.........
December 4, 2008 at 7:16 am
You can use the Execute Process task when calling the Winzip command line executable.
Tim Mitchell, Microsoft Data Platform MVP
Data Warehouse and ETL Consultant
TimMitchell.net | @Tim_Mitchell | Tyleris.com
ETL Best Practices
December 4, 2008 at 8:31 am
I did but it is giving me an
error:Invalid FileName:@@[User::strSourceFileZip].Zip
Executable:C:\Program Files (x86)\WinZip\WINZIP32.EXE
Arguments: -e @[User::strSourceFileZip]
WorkingDir:U:\InformationTechnology\Datawarehouse\Do
Is there any thing i need to add
December 4, 2008 at 9:00 am
It looks like you're adding the variable name to the Arguments field, which is interpreting it as a literal. You'll need to use an Expression to assign the variable as an argument, doing something like
" -e " + @[User::strSourceFileZip]
as the expression.
hth,
Tim
Tim Mitchell, Microsoft Data Platform MVP
Data Warehouse and ETL Consultant
TimMitchell.net | @Tim_Mitchell | Tyleris.com
ETL Best Practices
December 4, 2008 at 10:21 am
I have done this before as below.Download Winzip Command Line Utility.
In Process Task
Executable : C:\Program Files\WinZip\WZUNZIP.EXE
Arguments : -e User::fileName
Working Dir : C:\Temp
Where User::fileName is a variable that stores the file name to be unzipped.
December 4, 2008 at 12:12 pm
No If i use varible to pass the filename its not working But if put the file path name in quotes its working
In Process Task
Executable : C:\Program Files\WinZip\WZUNZIP.EXE
Arguments : -e "U:\InformationTechnology\Doral.zip"
WorkingDir : U:\InformationTechnology
December 4, 2008 at 1:46 pm
Raghu,
Try this,I revisited my code and did a test run.I was able to unzip my file.
Executable : C:\Program Files\WinZip\WZUNZIP.EXE
Argument : Leave Blank
Working Dir : C:\temp\
Now go to Expression Tab, Pick Arguments, And type in this
"-e -o " + @[User::fileName]
and click Evaluate Expresssion.
@[User::fileName] =refers to the file name to be unzipped.Make sure you have this created.
Let me know if it does not work out for you.
December 4, 2008 at 2:11 pm
No still i am facing the same prob...
"-e -o " + @[User::fileName]== after cliking evaluation button
Its just showing -e-o......But still its not working ...
When i use "-e -o " + "@[User::fileName]"
It is showing -e -o @[User::fileName]......Even though it is showing the same error
December 4, 2008 at 2:24 pm
Hey its working...
when i use the this file path as variable
C:\t\Dral_ENC.zip
But my file is in another folder
C:\Information technology\Dral\Dral_ENC
Its saying C:\Information .zip is not found.....
What might be the error .Its in not recognizing the spaces.
December 4, 2008 at 2:27 pm
raghu (12/4/2008)
No still i am facing the same prob..."-e -o " + @[User::fileName]== after cliking evaluation button
Its just showing -e-o......But still its not working ... [It will only show -e -o,as the package is not executing and value of User::fileName is not being passed] --This is fine
When i use "-e -o " + "@[User::fileName]"
It is showing -e -o @[User::fileName]......Even though it is showing the same error
.
Could you let me know how you set your variable ?
December 4, 2008 at 2:29 pm
raghu (12/4/2008)
Hey its working...when i use the this file path as variable
C:\t\Dral_ENC.zip
But my file is in another folder
C:\Information technology\Dral\Dral_ENC
Its saying C:\Information .zip is not found.....
What might be the error .Its in not recognizing the spaces.
Raghu, Im not quite understanding. Is the zip file name
C:\Information technology\Dral\Dral_ENC without a ".zip" extension ?
December 4, 2008 at 3:06 pm
This is the zip file location
C:\Information technology\Dral\Dral_ENC.zip
December 4, 2008 at 3:18 pm
raghu (12/4/2008)
This is the zip file locationC:\Information technology\Dral\Dral_ENC.zip
Raghu,
Look like the problem is because the file path has space in them "Information Technology"
I changed Information Technology to InformationTechnology without the space and got it to work.
Try executing the command to unzip form command line,see if it takes in the file path with the space [as is].
Let me know
Viewing 15 posts - 1 through 15 (of 32 total)
You must be logged in to reply to this topic. Login to reply