Nigel Whitworth's Development Site

You are currently not logged in.

How do I execute another program from VB.NET?

If you want to run another program whilst inside another program, you can use the following code to do that.

Public Function Execute(ByVal ProcessPath As String, bWait as boolean) as boolean
     Dim objProcess As System.Diagnostics.Process

     Try

          objProcess = New System.Diagnostics.Process
          objProcess.StartInfo.FileName = ProcessPath
          objProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal
          objProcess.Start

          If (bWait = True) Then
               objProcess.WaitForExit
          End If

          objProcess.Close

          Return True
     Catch
          Return False
     End Try
End Function



If you intend to vote or make a comment, please enter the security code.

Make a comment

*Comments are the views of individuals, they may or may not be correct.
All comments are reviewed and accepted or rejected.
If you give an email address, you will be sent an email when someone makes a comment on this page.*

Name :
Email :
Comments :


Only name and Code is compulsory.
 
 
Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)