Solved

Using the Process to launch a program

Posted on 2013-12-16
1
250 Views
Last Modified: 2013-12-17
Hello,

I have some code that launches a process to unzip some files.

        Dim myproc As Process = New Process
        myproc.StartInfo.WorkingDirectory = Chr(34) & Folder & Chr(34)
        myproc.StartInfo.FileName = Chr(34) & rar & Chr(34)
        myproc.StartInfo.Arguments = "x -Y " & Chr(34) & Folder & "\*.zip" & Chr(34)
        myproc.Start()
        MsgBox(myproc.ExitCode)
        myproc.WaitForExit()

If I open a dos box and do the equivalent it works perfectly, but for some reason this exists with exitcode 0 and nothing happens...

Any ideas?

tnx
~j
0
Comment
Question by:prosit
1 Comment
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
ID: 39724347
You should check the output and error, by getting the StandardOutput and StandardError.

Example:

Dim ErrorString As String = Process.StandardError.ReadToEnd()

Open in new window

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

828 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