[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2006-04-27
2
Medium Priority
?
217 Views
Last Modified: 2012-06-21
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 )
            

0
Comment
Question by:ricke07fe1
2 Comments
 
LVL 23

Accepted Solution

by:
naveenkohli earned 2000 total points
ID: 16557771
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
 

Author Comment

by:ricke07fe1
ID: 16566400
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

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Integration Management Part 2
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question