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

Posted on 2006-04-27
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("")
                   intReturn = wshell.EXEC("%comspec% /c c:\Program Files\WinZip\wzzip", 0, True)        
            Response.Write( intReturn )

Question by:ricke07fe1
    LVL 23

    Accepted Solution

    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.

    Author Comment

    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\ d:\DataFolder\*.ptf"

    Thankyou for your recommendation.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Top 6 Sources for Identifying Threat Actor TTPs

    Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

    Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Migrating to Microsoft Office 365 is becoming increasingly popular for organizations both large and small. If you have made the leap to Microsoft’s cloud platform, you know that you will need to create a corporate email signature for your Office 365…

    758 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

    Need Help in Real-Time?

    Connect with top rated Experts

    11 Experts available now in Live!

    Get 1:1 Help Now