Solved

Using the Process to launch a program

Posted on 2013-12-16
1
245 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

708 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now