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
mgmhicksAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Mike TomlinsonConnect With a Mentor Middle School Assistant TeacherCommented:
It probably needs quotes around the path names (This is untested since I don't have wzunzip):

Private Sub Command1_Click()
    Dim cmdLine As String
    cmdLine = Chr(34) & "C:\Program Files\WinZip\wzunzip" & Chr(34) & " " & Chr(34) & "c:\program files\unzip\ppro992.zip" & Chr(34) & " " & Chr(34) & "c:\program files\unzip\unziptest" & Chr(34)
    Shell cmdLine
End Sub

~IM
0
 
vinnyd79Commented:
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
0
 
mgmhicksAuthor Commented:
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.

0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
Éric MoreauSenior .Net ConsultantCommented:
0
 
GeoffKImCommented:
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.
0
 
GeoffKImCommented:
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.
0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
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

0
All Courses

From novice to tech pro — start learning today.