C# System.Diagnostics.Process: can't launch a 32 bit exe file in 64 bit OS

后端 未结 4 1958
梦如初夏
梦如初夏 2021-01-14 06:01

I have a 32 bit exe file compiled with Turbo Pascal. I need to launch it. It worked well when I had Windows 7 32 bit, but now I\'m on Windows 7 64 bit, and I get the followi

4条回答
  •  北海茫月
    2021-01-14 06:12

    You can launch 32bit application from 64bit application.

    C# Example 1:

    var processStartInfo = new ProcessStartInfo("C:\MyApp.exe");
    var process = new Process { StartInfo = processStartInfo };
    process.Start();
    process.WaitForExit();
    

    C# Example 2:

    System.Diagnostics.Process.Start("C:\MyApp.exe");
    

提交回复
热议问题