Start a command line including arguments from C#

后端 未结 3 1242
不知归路
不知归路 2021-01-15 11:33

I need to start a complete command line like \"app.exe /arg1:1 /arg2:true\" from my C# app.

Process.Start and ProcessStartInfo needs to have the filename and argumen

3条回答
  •  谎友^
    谎友^ (楼主)
    2021-01-15 11:51

    Yes, you can launch cmd.exe with the full command-line you want to send as the arguments.

    info.FileName = "cmd.exe";
    info.Arguments = "app.exe /arg1:1 /arg2:true";
    

提交回复
热议问题