How to unzip files in DTS package?


Hi experts,

I have a DTS package. and need to upzip all the zipped files in a directory. I just followed the scripts that  "arbert" solution given out in 2004 march 29. however, I didn't get it through by following like this:


EXEC master..xp_cmdshell C:\Progra~1\utility\WinZip\winzip32 -e
'C:\DATA\FTP_Download\ca_account_sales_org.zip C:\DATA\FTP_Download\'
go

Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '\'.

Please help


LIULIHUAAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Guy Hengel [angelIII / a3]Billing EngineerCommented:

EXEC master..xp_cmdshell "C:\Progra~1\utility\WinZip\winzip32 -e
'C:\DATA\FTP_Download\ca_account_sales_org.zip C:\DATA\FTP_Download\'"
Aneesh RetnakaranDatabase AdministratorCommented:
EXEC master..xp_cmdshell "C:\Progra~1\utility\WinZip\winzip32 -e C:\DATA\FTP_Download\ca_account_sales_org.zip C:\DATA\FTP_Download\ "
LIULIHUAAuthor Commented:
This is not works.

It hangs:

EXEC master..xp_cmdshell "C:\Progra~1\utility\WinZip\winzip32 -e
'C:\DATA\FTP_Download\ca_account_sales_org.zip C:\DATA\FTP_Download\'"

I have to kill it.

Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

LIULIHUAAuthor Commented:
Hi aneeshattingal,

EXEC master..xp_cmdshell "C:\Progra~1\utility\WinZip\winzip32 -e C:\DATA\FTP_Download\ca_account_sales_org.zip C:\DATA\FTP_Download\ "

this is not work neither, it hangs too.
Aneesh RetnakaranDatabase AdministratorCommented:
EXEC master..xp_cmdshell "C:\Progra~1\utility\WinZip\winzip32 -e
'C:\DATA\FTP_Do~1\ca_acc~1.zip C:\DATA\FTP_Do~1\'"
LIULIHUAAuthor Commented:

It hangs again.
LIULIHUAAuthor Commented:
Hi aneeshattingal,

Do you have time to this issue?

I have no idea why it is not working, I know the code should be run. Any help appreciate.

LIULIHUAAuthor Commented:
Hi experts,

I tried the following command at C:\prompt at my laptop which has SQL server indevidual version installed and it works.

C:>C:\progra~1\utility\Winzip\Winzip32 -e C:\DATA\FTPDownload\ca_accounts.zip C:\DATA\FTPDownload\

However, when I copy the same code to SQL Query Analyzer, it give me an error:

Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near '\'.
Server: Msg 132, Level 15, State 1, Line 2
The label 'C' has already been declared. Label names must be unique within a query batch or stored procedure.
Server: Msg 132, Level 15, State 1, Line 2
The label 'C' has already been declared. Label names must be unique within a query batch or stored procedure.

Any help would appraciate
nito8300Commented:
i'm guessing you have the winzip cmd add-in from: http://www.winzip.com/downcl.htm 

on query analyzer:

EXEC master..xp_cmdshell C:\progra~1\utility\Winzip\Winzip32 -e C:\DATA\FTPDownload\ca_accounts.zip C:\DATA\FTPDownload


---------------------------------------------------------------------------------------------------
here's some additional help:
Using the WinZip Command Line Support Add-On
The WinZip Command Line Support Add-On is used by executing a command that starts WZZIP or WZUNZIP. There are three "places" where you can use the Add-On:

·      In a command window, sometimes known as a DOS window or DOS box.  This is a separate window that is normally started by selecting "MS-DOS Prompt" or "Command Prompt" from the Start menu; it normally displays the C> prompt.
·      From the Run dialog, accessed from the Start menu.
·      In batch files or other scripts (such as application program macros).

The exact format of the command depends on which of these you use.

Using a command window

You can use the Add-On in a command window in any of these ways:

·      You can type the full name of the WinZip folder followed by the name of the command, which is either "WZZIP" (for zipping) or "WZUNZIP" (for unzipping), followed by the parameters necessary for the operation.  For example, if you installed WinZip into the C:\Program Files\WinZip folder and you want to list the contents of MyFile.zip, you might type:

      "c:\program files\winzip\wzzip" -v MyFile.zip

(Note that you must use quotes around the command name if the name of the folder includes spaces, as shown above.  Otherwise, the quotes are not necessary.)

·      You can copy WZZIP.EXE and WZUNZIP.EXE to a folder specified in your PATH environment variable.  Then you can run the commands by simply typing "WZZIP" or "WZUNZIP" and the desired parameters, without the name of the WinZip folder:

      wzzip -v filename.zip
·      You can add the WinZip folder to your PATH environment variable, for example:

      set path=c:\windows;"c:\program files\winzip";...

If you have done this, you can run the commands at the system prompt by simply typing "WZZIP" or "WZUNZIP" followed by the desired parameters, without the name of the WinZip folder:

      wzzip -v filename.zip

(For information on the PATH environment variable, please refer to your Windows documentation.  If you use this method regularly, you will probably want to edit AUTOEXEC.BAT so that the WinZip folder is permanently added to the PATH environment variable.)

Using the Run dialog

You can use WZZIP.EXE and WZUNZIP.EXE from the Run dialog by simply typing the command name and any desired parameters.  It is not necessary to include the WinZip folder, but you may need to specify the folder for the files you wish to work with.  For example:

wzzip -yp -v c:\temp\filename.zip

We recommend using the -yp option to keep the MS-DOS command prompt window from closing automatically; otherwise, you will not have much time to look at the results of your command.

Using batch files

You can use WZZIP.EXE and WZUNZIP.EXE in MS-DOS batch files using the same rules as shown above for command windows.
The procedure will be similar for script processors other than MS-DOS batch files (application program macros, for example).  However, check your documentation for information on how paths should be specified.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
LIULIHUAAuthor Commented:
Hi nito8300,

Thank you for the valuable feedback, this is really big help.
nito8300Commented:
welcome
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft SQL Server

From novice to tech pro — start learning today.