Manage .exe files
Use System.IO.File.Exists and System.Diagnostics.Process.Start.
Dim someExe As String = "MyAppsPath\some.exe"
Dim fullPath As String = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), someExe)
If File.Exists(fullPath) Then 'Checks for the existence of the file
Process.Start(fullPath) 'Executes it
End If
source to share
Check out the System.Diagnostics.Process class . The MSDN page has a perfect code snippet, so I won't duplicate it here.
The best thing about Process is that you can actually run a file (say an HTML file) and it will open using the user's default browser. Many common programs also accept command line parameters - many browsers accept a URL as a command line parameter, so you can open a specific URL.
source to share
http://msdn.microsoft.com/en-us/library/system.diagnostics.process.start.aspx
openFileDialog od = new OpenFileDialog (); string path = od.ToString () System.Diagnostics.Process.Start (path)
source to share
You can use System.Diagnostics.Process to execute the .EXE and even capture the output if it is a console / command line application. You will have something like this (but keep in mind that this is simplified a bit!):
dim process as System.Diagnostics.Process
process.StartInfo.FileName = "program.exe" ' You need to be smarter here!
process.StartInfo.Arguments = "whatever command line options you need"
process.Start()
To check if the program is running, you call
process.HasExited()
If you want to capture the output, you need to set StartInfo.RedirectStandardOutput to True.
source to share