Link to home
Start Free TrialLog in
Avatar of mgmhicks
mgmhicks

asked on

running wzunzip in vb

How can I run the wzunzip add on within a vb program.  I use the shell command and I can get the help to come up, but if I add parameters then it just blows by it without doing anything.  This is what I tested so far  Shell "C:\Program Files\WinZip\wzunzip ppro992.zip".  From a command prompt the it would look like this.

wzunzip c:\program files\unzip\ppro992.zip c:\program files\unzip\unziptest

thanks
Avatar of vinnyd79
vinnyd79

Does this work?

Private Sub Command1_Click()
Shell Environ("ComSpec") & " /c wzunzip c:\program files\unzip\ppro992.zip c:\program files\unzip\unziptest"

End Sub
Avatar of mgmhicks

ASKER

Sorry no go.  Just runs right through the shell command.

if I use

Shell "C:\Program Files\WinZip\wzunzip "

i get the help screen like it took wzunzip, with no parameters, however if I try and add parameters it just runs right through it.

ASKER CERTIFIED SOLUTION
Avatar of Mike Tomlinson
Mike Tomlinson
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
The Accepted Solution above does not work for me

Shell "C:\Program Files\WinZip\WZUNZIP.EXE" "\\SERVER\Users\Geoff\t.zip"

does not work in VB.net. The WZUNZIP.EXE command help/reference screen opens.

When I paste the same command in the Windows 7 Start-Run dialog box, It runs fine.

"C:\Program Files\WinZip\WZUNZIP.EXE" "\\SERVER\Users\Geoff\t.zip" in windows run works.
Never mind - I changed My code from:

"""" & Cmd & """"
to:

Chr(34) & cmd & Chr(34)

it works now. I really dont know why it did not work. The """" code works on an XP machine. But I will not arque with success.
For VB.Net, try something like this:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim File As String = "C:\Program Files\WinZip\WZUNZIP.EXE"
        Dim Arg As String = "\\SERVER\Users\Geoff\t.zip"
        Dim P As New Process
        P.StartInfo.FileName = File
        P.StartInfo.WorkingDirectory = System.IO.Path.GetDirectoryName(File)
        P.StartInfo.Arguments = Chr(34) & Arg & Chr(34)
        P.Start()
    End Sub

Open in new window