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
wzunzip c:\program files\unzip\ppro992.zip c:\program files\unzip\unziptest
thanks
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.
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The Accepted Solution above does not work for me
Shell "C:\Program Files\WinZip\WZUNZIP.EXE" "\\SERVER\Users\Geoff\t.zi p"
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.zi p" in windows run works.
Shell "C:\Program Files\WinZip\WZUNZIP.EXE" "\\SERVER\Users\Geoff\t.zi
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.zi
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.
"""" & 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
Private Sub Command1_Click()
Shell Environ("ComSpec") & " /c wzunzip c:\program files\unzip\ppro992.zip c:\program files\unzip\unziptest"
End Sub