'How to run an exe file from a Vb program
I use this code in VB to run an .EXE file that requires an input file and results in creation of an output file.
Process.Start("C:\glob.exe","C:\g.inp" )
It seems that the exe runs successfully but the output file don't get created.
Note when I run the exe file from cmd it makes the output files at the end so there's nothing wrong with the exe file.
Solution 1:[1]
Use the System.Diagnostics.Process with ProcessStartInfo to specify various parameters to launch your executable.
The Process class gives you more control on the launched program than the Shell function.
e.g.
Dim psi As New ProcessStartInfo
psi.FileName = "C:\glob.exe"
psi.Arguments = "C:\g.inp"
psi.Verb = "runas"
Process.Start(psi)
Solution 2:[2]
you can use shell function in vb.net Shell("C:\procexp.exe", AppWinStyle.NormalFocus)
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Pradeep Kumar |
| Solution 2 | user2085339 |
