[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 508
  • Last Modified:

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


0
LIULIHUA
Asked:
LIULIHUA
  • 6
  • 2
  • 2
  • +1
1 Solution
 
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\'"
0
 
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\ "
0
 
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.

0
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
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.
0
 
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\'"
0
 
LIULIHUAAuthor Commented:

It hangs again.
0
 
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.

0
 
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
0
 
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.
0
 
LIULIHUAAuthor Commented:
Hi nito8300,

Thank you for the valuable feedback, this is really big help.
0
 
nito8300Commented:
welcome
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

  • 6
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now