Shell function problem.

M

MrKrich

I use shell function to call winzip to unzip file. My
problem is I want it to show error if it get error such as
the file that it try to open is not .zip.
This is my code :
procID = Shell("C:\Program Files\Winzip\Winzip32.exe -min -
e -o -s c:\Temp\Myfile.Zip c:\Temp, , True)

At the moment the error message that I got is from winzip
itself.
 
K

Klaus H. Probst

Use System.Diagnostics.Process instead. You get an ExitCode value that,
assuming the application sets it, can be retrieved by your application to
determine whether or not an error occurred.
 
H

Herfried K. Wagner [MVP]

* "MrKrich said:
I use shell function to call winzip to unzip file. My
problem is I want it to show error if it get error such as
the file that it try to open is not .zip.
This is my code :
procID = Shell("C:\Program Files\Winzip\Winzip32.exe -min -
e -o -s c:\Temp\Myfile.Zip c:\Temp, , True)

At the moment the error message that I got is from winzip
itself.

Maybe 'System.Diagnostics.Process.Start' procides more information in
the returned 'Process' object. Nevertheless, you won't be able to turn
off the messagebox displayed by WinZip if there is no switch to do that
available.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top