i have this code:
private void button1_Click(object sender, EventArgs e)
{
Process p = new Process();
p.StartInfo.FileName = \"C:/Users/Valy/Desktop/
The problem is most likely that the 3dcw.exe is looking for files from it's current working directory. When you run an application using Process.Start
, the current working directory for that application will default to %SYSTEMROOT%\system32
. The program probably expects a different directory, most likely the directory in which the executable file is located.
You can set the working directory for the process using the code below:
private void button1_Click(object sender, EventArgs e)
{
string path = "C:/Users/Valy/Desktop/3dcwrelease/3dcw.exe";
var processStartInfo = new ProcessStartInfo();
processStartInfo.FileName = path;
processStartInfo.WorkingDirectory = Path.GetDirectoryName(path);
Process.Start(processStartInfo);
}