Connecting Tech Pros Worldwide Help | Site Map

Using Winzip with VB.Net

  #1  
Old June 30th, 2009, 02:05 AM
Newbie
 
Join Date: Jun 2009
Location: Taiwan
Posts: 1
I'm sorry if I post Winzip question here, but I met a problem. I was running Winzip command by using process in VB.Net, but I had error that I don't know how to trace.

1. I create a batch file: "C:/zipbatch.bat" that contains below zip command
winzip32.exe -min -a -ex "C:/zipfile.zip" "C:/sourcefile.csv"

2. I create new a process to run the zip command
Dim t_process As New System.Diagnostics.Process
t_process.StartInfo.FileName = "C:/zipbatch.bat"
t_process.Start()
t_process.WaitForExit()
dim t_iExitCode as Integer = t_process.ExitCode

3. Normally t_iExitCode will return 0 (zero) for a successful run. But I met a condition that the winzip return 0, but in fact it isn't totally successful.
The error message is that...
Winzip failed to rename the temp file into intended name, which is "C:/zipfile.zip"
So it happens that my file has been added to some "C:/ziptempfile.tmp", but then failed to be added to "C:/zipfile.zip"

Is there anybody knows how to detect such kind of condition, since the process returns me "success". For now, I wish I could detect the failure first, so that I can stop my next process. Or if anybody knows how this kind of issue could happen, please tell me. Thanks a lot.
Reply

Tags
exit code, process, winzip


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using a Process to Extract a file from Winzip archive learningvbnet answers 3 December 7th, 2007 02:30 PM
VB Net 2003 Deployment Failure Michael answers 0 November 21st, 2005 12:11 PM
Running WinZip command line from VB.Net Rob answers 3 November 20th, 2005 03:34 AM
WinZip wityh .Net EdB answers 4 July 22nd, 2005 12:50 AM