Running WinZip command line from VB.Net

R

Rob

No way this should be that difficult...

I have a program that does a file watch on a folder. When
a file is created in this folder, I simply want to zip it
up using WinZip (with the command line version of
WinZip). I have been unable to do so with any success. I
have been using DTE.ExecuteCommand to try and get this
working but the error "Command "wzzip.exe" is not valid."
keeps popping up.

Any help would be appreciated.

Thanks,
Rob
 
H

Herfried K. Wagner [MVP]

Rob said:
I have a program that does a file watch on a folder. When
a file is created in this folder, I simply want to zip it
up using WinZip (with the command line version of
WinZip). I have been unable to do so with any success. I
have been using DTE.ExecuteCommand to try and get this
working but the error "Command "wzzip.exe" is not valid."
keeps popping up.

Have a look at the 'System.Diagnostics.Process.Start' method and the
'ProcessStartInfo' class.
 
C

Christian Blackburn

Hi Rob,
While I don't know what type of distribution you are planning to use with
your application I can safely recommend that you not use the WinZip
command-line interface. For one I think there's a built-in compression
library in .net. For two there's also some windows API compression commands
if .NET doesn't have its own. For three there are number of excellent
freeware .dll options like ZLib and 7-Zip's (I don't know the name of the
file, but there is one and 7-Zip is currently the best universal compression
format that's publicly available). As far as I know you can't legally or
easily distribute WinZip command-line support. For one the user would have
to have WinZip + the command-line add-on or you'd have to install them. I
doubt WinZip Computing would allow you to do that with a little $. Not to
mention users would want to have your program installed and not WinZip too
as this would adversely affect their file associations, start menu, and free
disk space.
Cheers,
Christian
 
R

Rob

Christian and Herfried,

Thanks for the quick responses. The application is for
the company I work for and will not be distributed. The
machine that will house the application will have WinZip
on it. I just realized that I can use the "Shell" command
for what I need, but I will also take a closer look at the
built-in .NET compression lib as I believe that is a
better way to go.

Thanks again for the feeback.

Rob
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top