The Process class is very useful, I use the Process class for running third party and legacy programs. For example, I have an app written by a vendor that I need SQL functionality as well as the programs operation. These SQL tables contain data like when the program started, the name of the file processed, the status of the operation (running, failed, or successful), and time the process finished. The vendors program is a command-line program written in C++ unfortunately I couldn’t even use interop.
The StartInfo property has list of the properties and some of these are:
Filename value = String Arguments value = String WorkingDirectory value = String UseShellExcute value = Boolean RedirectStandardError value = Boolean RedirectStandardOutput value = Boolean CreateNoWindow value = BooleanSome of the methods are:
Start returns Boolean CloseMainWindow returns Boolean Kill Dispose
Imports System.Diagnostics
Module Module1
Sub Main()
Dim instance As New Process
instance.StartInfo.FileName = "notepad.exe"
instance.StartInfo.WorkingDirectory = "C:\"
instance.StartInfo.UseShellExecute = True
instance.Start()
instance.WaitForExit()
End Sub
End Module