' ' Start a new process (Notepad). ' Dim myProcess As Process = System.Diagnostics.Process.Start("MyTextFile.txt") ' ' Wait until it ends. ' myProcess.WaitForExit() MessageBox.Show("Notepad ended: " & myProcess.ExitTime & "." & _ System.Environment.NewLine & "Exit Code: " & myProcess.ExitCode) ' ' Close the process to free resources. ' myProcess.Close()