I know how to run an external application in C# System.Diagnostics.Process.Start(executableName);
but what if the application I want to run has extension that is not recognizable by Windows as extension of an executable. In my case it is application.bin
.
Yes – simply entering the program's full filename usually works. (The .exe requirement only exists in the GUI shell.) (It might be that the file needs an extension, though – so if you can't get MyProgram to run, rename it to MyProgram. notexe or MyProgram.
application is a manifest file containing details about the application to be deployed. Setup.exe is a setup launcher/bootstrapper provided by the framework. It reads manifest data in the clickonce source folder and effects the necessary changes on the clients machine to enable the app run.
Binary executables in Linux usually use the ELF (Executable and Linkable Format) file format. These are Linux's equivalent to the PE (Portable Executable) format used in Windows or the MZ and NE formats used in DOS and early Windows versions, all of which used the EXE file extension.
.exe is a common filename extension denoting an executable file (the main execution point of a computer program) for Microsoft Windows.
Key is to set the Process.StartInfo.UseShellExecute
property to false
prior to starting the process, e.g.:
System.Diagnostics.Process p = new System.Diagnostics.Process();
p.StartInfo.FileName = @"c:\tmp\test.bin";
p.StartInfo.UseShellExecute = false;
p.Start();
This will start the process directly: instead of going through the "let's try to figure out the executable for the specified file extension" shell logic, the file will be considered to be executable itself.
Another syntax to achieve the same result might be:
var processStartInfo = new ProcessStartInfo
{
FileName = @"c:\tmp\test.bin",
UseShellExecute = false
};
Process.Start(processStartInfo);
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