How to run the program and wait for its completion?

  • 2
    @ Magomed, apparently a trick question> * Clarify your question * - Niki-Timofe

1 answer 1

For example:

Public Sub RunProcess(ByVal ProcessPath As String) Dim objProcess As System.Diagnostics.Process Try objProcess = New System.Diagnostics.Process() objProcess.StartInfo.FileName = ProcessPath objProcess.StartInfo.WindowStyle = ProcessWindowStyle.Normal objProcess.Start() objProcess.WaitForExit() objProcess.Close() Catch MessageBox.Show("Could not start process " & ProcessPath, "Error") End Try End Sub 

Link to the source.