我有一個啓動命令的.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>