how to execute console application from windows form?

后端 未结 8 958
感情败类
感情败类 2020-12-09 11:43

I want to run a console application (eg app.exe) from a windows form load event. I\'v tried System.Diagnostics.Process.Start(), But after it opens app.exe, it closes it immi

8条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-09 11:49

    If you are just wanting the console window to stay open, you could run it with something like this command:

    System.Diagnostics.Process.Start( @"cmd.exe", @"/k c:\path\my.exe" );
    

提交回复
热议问题