.Net Core 2.0 Process.Start throws "The specified executable is not a valid application for this OS platform"

You can also set the UseShellExecute property of ProcessStartInfo to true

var p = new Process();
p.StartInfo = new ProcessStartInfo(@"C:\Users\user2\Desktop\XXXX.reg")
{ 
    UseShellExecute = true 
};
p.Start();

Seems to be a change in .net Core, as documented here.


You can set UseShellExecute to true and include this and your path in a ProcessStartInfo object:

Process.Start(new ProcessStartInfo(@"C:\Users\user2\Desktop\XXXX.reg") { UseShellExecute = true });

You have to execute cmd.exe

var proc = Process.Start(@"cmd.exe ",@"/c C:\Users\user2\Desktop\XXXX.reg")

don't forget the /c