I have to compile a game like this
love "C:\testgame"
in the cmd. So I use this code, but it seems like the parameter is missinterpreted. Also, the console closes after a sec. But if I use Messagebox.Show I can see the command in the cmd is the same I manually use (and this works)
Process cmd = new Process();
cmd.StartInfo.FileName = "cmd.exe";
cmd.StartInfo.RedirectStandardInput =
true;
cmd.StartInfo.RedirectStandardOutput =
true;
cmd.StartInfo.CreateNoWindow = false;
cmd.StartInfo.UseShellExecute = false;
cmd.Start();
cmd.StandardInput.Write(@"cd %ProgramFiles(x86)%\LOVE\");
MessageBox.Show("love \""+fldBrowDiag.SelectedPath.ToString()+@"\"+lsb_projects.SelectedItem.ToString()+"\"");
cmd.StandardInput.Close();
cmd.Close();
@"cd %ProgramFiles(x86)%\LOVE\"to change the working directory in that case.StartInfoobject, you can set itsWorkingDirectoryproperty to achieve the same effect as executing acdcommand.