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

前端 未结 5 537
走了就别回头了
走了就别回头了 2020-12-03 16:34

I need to let a .reg file and a .msi file execute automatically using whatever executables these two file types associated with on user\'s Windows.

.NET Core 2.0 Pro

5条回答
  •  北荒
    北荒 (楼主)
    2020-12-03 17:29

    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 });
    

提交回复
热议问题