Can you execute another EXE file from within a C# console application?
FileName = "dcm2jpg.exe"; startInfo. WindowStyle = ProcessWindowStyle. Hidden; startInfo. Arguments = "-f j -o \"" + ex1 + "\" -z 1.0 -s y " + ex2; try { // Start the process with the info we specified. // Call WaitForExit and then the using statement will close.
After a developer writes the C# code, he or she compiles their code. This results in Common Intermediate Language stored within Portable Executable (PE for 32-bit, PE+ for 64-bit) files such as “.exe” and “. dll” files for Windows. These files are distributed to users.
An executable file (EXE file) is a computer file that contains an encoded sequence of instructions that the system can execute directly when the user clicks the file icon.
Like this:
var proc = new Process(); proc.StartInfo.FileName = "something.exe"; proc.StartInfo.Arguments = "-v -s -a"; proc.Start(); proc.WaitForExit(); var exitCode = proc.ExitCode; proc.Close();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With