Solved

Using the Process to launch a program

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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

630 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