Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
madmanny
Starting Member
4 Posts |
Posted - 2005-08-25 : 08:08:17
|
| Hi, I am developing a DTS package on a remote server and I need to ZIP files before FTPing them to another server. In Query analyser I can run all sorts of command line commands via xp_cmdshell but when I try to run the following it hangs. I can run this in a command window and on my destination server in Query Analyser and it works. I believe it is securty related but I cant find any information on what changes I have to make to let this work. The SQL login is in sysadmin and if I use a windows login thats in the Administrators group. So hope that makes sense but Im stuck! Any ideas are appreciated.EXEC master..xp_cmdshell 'c:\progra~1\winzip\wzzip.exe -yb "C:\test.zip" "C:\testing.txt" > c:\output.txt' |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-08-25 : 08:35:41
|
| Hi madmanny, Welcome to SQL Team!When you run it from DOS do you get any interactive prompts come up?When you run it autoMagically what do you get in c:\output.txt ?We stopped using WinZip for this job because it was not possible (at that time) to disable all interactive prompts, and used the command line verison of PKZip instead.The "user" configured to run the SQL Service needs to be configured with appropriate permissionsKristen |
 |
|
|
madmanny
Starting Member
4 Posts |
Posted - 2005-08-25 : 09:34:47
|
| Hi Kristen, Output.txt only has the followingWinZip(R) Command Line Support Add-On Version 1.1 SR-1 (Build 6224)Copyright (c) WinZip Computing, Inc. 1991-2004 - All Rights ReservedI use the -yb switch to disable any interactivity but I get the same result.The user permissions is were I believe this is where the problem is. I have tried using a windows admin login in SQL which as in sysadmins but this also failed. Its funny because when I run it in Query Analyser, a WZZIP process is started but does nothing. I have to kill it manually in order to cancel the Query Analyser execution.How successful have you been with PKZip?Cheers, Manny |
 |
|
|
madmanny
Starting Member
4 Posts |
Posted - 2005-08-25 : 10:21:07
|
| AND.....this works but creating a zip file doesntEXEC master..xp_cmdshell 'c:\progra~1\winzip\wzzip.exe -v "C:\test.zip"'This displays a list of files in a zipfile. |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-08-25 : 10:29:51
|
| "How successful have you been with PKZip?"The syntax is a bit scary! but it has run as a batch task for years without any trouble that I can remember [TouchWood!]Kristen |
 |
|
|
madmanny
Starting Member
4 Posts |
Posted - 2005-08-25 : 11:12:42
|
| BIG "THANK YOU" Kristen....tried PKZIP and it works! My nightmare is over. YAY |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-08-25 : 12:12:54
|
| Take care to look out for any parameters that might interactively ask a question. I think we use "noFix"kristen |
 |
|
|
|
|
|