How do you invoke the WinZip line command interface from a .net VB Script

I am attempting to selectively zip files from a .net WEB applicaiton.  My research so far has been in the driection of WSH but with no success.  Am I on the right path or should I use a different method?

Here is the code I am using.

                                 Dim wshell, intReturn
            wshell = server.createobject("wscript.shell")
                   intReturn = wshell.EXEC("%comspec% /c c:\Program Files\WinZip\wzzip test.zip", 0, True)        
            Response.Write( intReturn )
            

ricke07fe1Asked:
Who is Participating?
 
naveenkohliCommented:
You can invoke WinZip process process using System.Diagnostics.Process object. There is no need to use CreateObject stuff.
You will have to fix permisisons on winzip app so that ASPNET user context can invoke it.

I would suggestusing open source library like SharpLib or other third party libraries that do not require to invoke an executable.
0
 
ricke07fe1Author Commented:
This approach appears to work, please note this code is VB Script.

It is necessary to first import the following class

<%@ Import Namespace="System.Diagnostics" %>

Then the following code will work


Dim startInfo As New ProcessStartInfo("wzzip.exe")
startInfo.Arguments = "d:\TestFolder\test.zip d:\DataFolder\*.ptf"
Process.Start(startInfo)

Thankyou for your recommendation.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.