Imports System.Diagnostics
Namespace ConsoleApplication1
Class Program
Private Shared Sub Main(args As String())
Dim exitCode = -1
Using proc As New Process()
'Set the working directory for the process to be started
proc.StartInfo.WorkingDirectory = "C:\"
'Set the doucment name to start
proc.StartInfo.FileName = "StartAppPool.bat"
'Execute the process
proc.Start()
'Wait for the associated process to exit
proc.WaitForExit()
'Gets the value of the associated process specified when it terminated.
exitCode = proc.ExitCode
End Using
If exitCode = 0 Then
Console.WriteLine("Batch executed successfully")
Else
Console.WriteLine("Some problem happened while executing the batch program")
End If
Console.ReadKey()
End Sub
End Class
End Namespace