tags:

views:

54

answers:

1

Hello everybody!

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.

Regards.

+11  A: 

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.

mdb
thanks a lot ;)
Balon
nice explanation :-)
Chad