Solved

Using the Process to launch a program

Posted on 2013-12-16
1
252 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

734 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