locked
run unmanaged app from managed app RRS feed

  • Question

  • well, I have aconsole application which I need it to activate an exe file(not written in .net) and get its screen output(the exe is also console application).
    the question is how I do it and if there is a difference in activating regular exe and .net written exe?
    I tried using AppDomain.CurrentDomain.ExecuteAssembly but it gave me
    "The format of the file 'sftpc.exe' is invalid." exception
    Tuesday, September 27, 2005 9:25 AM

Answers

  • Hi,

    You could take a look on the Process object. Its in the System.Diagnostics namespace. It could start an app by Process.Start(<path>). Try tweaking with it...

     

     

    cheers,

    Paul June A. Domag

    Tuesday, September 27, 2005 10:05 AM

All replies

  • Regular exe files are not .NET assemblies, so you can't use ExecuteAssembly. Instead, create a new process and redirect the standard output of that back to your application:

    http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=25560
    Tuesday, September 27, 2005 9:31 AM
  • Hi,

    You could take a look on the Process object. Its in the System.Diagnostics namespace. It could start an app by Process.Start(<path>). Try tweaking with it...

     

     

    cheers,

    Paul June A. Domag

    Tuesday, September 27, 2005 10:05 AM