我有一个启动命令的.bat文件,我想废除使用.bat文件并以编程方式在C#中启动进程。在cmd中需要帮助启动命令通过C#
这里是蝙蝠命令行
start ShooterGameServer.exe TheIsland?QueryPort=27015?SessionName=ARKServer?MaxPlayers=5?listen?ServerPassword=55555?ServerAdminPassword=55555 -nosteamclient -game -server -log
我已尝试设置它像在C#
Process.Start("CMD.exe", string.Format("Start {0} TheIsland?QueryPort=27015?SessionName?{1}?MaxPlayers={3}?listen?ServerPassword={2}?ServerAdminPassword={2} -nosteamclient -game -server -log", ArkServer.FileName, textBox1.Text, textBox2.Text, numericUpDown1.Value.ToString()));
所有我结束了在C#中运行命令后是一个cmd窗口这个印有
C:\Users\*******\Documents\Visual Studio 2013\Projects\ArkProfileEditor\ArkProfi
leEditor\bin\Debug>