Connecting Tech Pros Worldwide Forums | Help | Site Map

Running WinZip command line from VB.Net

Rob
Guest
 
Posts: n/a
#1: Nov 20 '05
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

Herfried K. Wagner [MVP]
Guest
 
Posts: n/a
#2: Nov 20 '05

re: Running WinZip command line from VB.Net


"Rob" <rob@d-conztrakt.com> scripsit:[color=blue]
> 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.[/color]

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

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Christian Blackburn
Guest
 
Posts: n/a
#3: Nov 20 '05

re: Running WinZip command line from VB.Net


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
"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message
news:etJPlG5iDHA.1960@TK2MSFTNGP12.phx.gbl...[color=blue]
> "Rob" <rob@d-conztrakt.com> scripsit:[color=green]
> > 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.[/color]
>
> Have a look at the 'System.Diagnostics.Process.Start' method and the
> 'ProcessStartInfo' class.
>
> --
> Herfried K. Wagner
> MVP · VB Classic, VB.NET
> <http://www.mvps.org/dotnet>[/color]


Rob
Guest
 
Posts: n/a
#4: Nov 20 '05

re: Running WinZip command line from VB.Net



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
[color=blue]
>-----Original Message-----
>Hi Rob,
>While I don't know what type of distribution you are [/color]
planning to use with[color=blue]
>your application I can safely recommend that you not use [/color]
the WinZip[color=blue]
>command-line interface. For one I think there's a built-[/color]
in compression[color=blue]
>library in .net. For two there's also some windows API [/color]
compression commands[color=blue]
>if .NET doesn't have its own. For three there are number [/color]
of excellent[color=blue]
>freeware .dll options like ZLib and 7-Zip's (I don't know [/color]
the name of the[color=blue]
>file, but there is one and 7-Zip is currently the best [/color]
universal compression[color=blue]
>format that's publicly available). As far as I know you [/color]
can't legally or[color=blue]
>easily distribute WinZip command-line support. For one [/color]
the user would have[color=blue]
>to have WinZip + the command-line add-on or you'd have to [/color]
install them. I[color=blue]
>doubt WinZip Computing would allow you to do that with a [/color]
little $. Not to[color=blue]
>mention users would want to have your program installed [/color]
and not WinZip too[color=blue]
>as this would adversely affect their file associations, [/color]
start menu, and free[color=blue]
>disk space.
>Cheers,
>Christian
>"Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> [/color]
wrote in message[color=blue]
>news:etJPlG5iDHA.1960@TK2MSFTNGP12.phx.gbl...[color=green]
>> "Rob" <rob@d-conztrakt.com> scripsit:[color=darkred]
>> > I have a program that does a file watch on a folder. [/color][/color][/color]
When[color=blue][color=green][color=darkred]
>> > a file is created in this folder, I simply want to [/color][/color][/color]
zip it[color=blue][color=green][color=darkred]
>> > up using WinZip (with the command line version of
>> > WinZip). I have been unable to do so with any [/color][/color][/color]
success. I[color=blue][color=green][color=darkred]
>> > have been using DTE.ExecuteCommand to try and get this
>> > working but the error "Command "wzzip.exe" is not [/color][/color][/color]
valid."[color=blue][color=green][color=darkred]
>> > keeps popping up.[/color]
>>
>> Have a look at the 'System.Diagnostics.Process.Start' [/color][/color]
method and the[color=blue][color=green]
>> 'ProcessStartInfo' class.
>>
>> --
>> Herfried K. Wagner
>> MVP · VB Classic, VB.NET
>> <http://www.mvps.org/dotnet>[/color]
>
>
>.
>[/color]
Closed Thread