C # System.Diagnostics.Process: cannot run 32-bit exe file on 64-bit OS

I have a 32-bit exe file compiled with Turbo Pascal. I need to run it. It worked well when I had 32-bit Windows 7, but now I am on a 64-bit version of Windows 7 and I get the following exception:

The specified executable file is not a valid application for this OS platform.

To make sure that it works on 32-bit systems, I launched the C # program on a 32-bit platform - it works.

So, how can I run a 32-bit exe file on a 64-bit OS?

thank

+3
source share
4 answers

Turbo Pascal 16- , , 32- . 16- , CPU ( 8086). , 64- .

16- 64- . , DOSBox.

+11

32- exe .NET(#), .NET x86. , 64- 64- , , 32- .

: MSDN , : http://msdn.microsoft.com/en-us/library/5b4eyb0k.aspx

2: , , 64- 32- exe. , 32- DLL 64- . , , , System.Diagnostics.Process exe.

+2

You can run a 32-bit application from a 64-bit 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");
+2
source

I don’t think there is a 64-bit compiler for Turbo Pascal, so I think that your only choice is to compile a 32-bit environment-oriented application.

+1
source

Source: https://habr.com/ru/post/1767002/


All Articles