Is it possible to start a console application with the System.Diagnostics.Process , BUT so that it starts up and I can manually enter the data I need into the running console application? If so, how can this be done or where can I get information about it?

Roughly speaking, I need my program to open this console application in the same way as if I had started this console application myself and started working with it further.

 Process myProcess = new Process(); myProcess.StartInfo.UseShellExecute = false; myProcess.StartInfo.FileName = "objectmaker\\objectmarker.exe"; myProcess.StartInfo.CreateNoWindow = false; myProcess.Start(); 
  • What have you tried to do? - Igor
  • @Igor I tried to start using Process using the standard, but the application opens and immediately closes. I feel that close, but something is missing. Process myProcess = new Process(); myProcess.StartInfo.FileName = "objectmaker\\objectmarker.exe"; myProcess.StartInfo.CreateNoWindow = false; myProcess.Start(); - Simon Barkovsky pm

1 answer 1

I think I get it. The application objectmarker.exe itself in my case runs without problems. This application initially takes .bmp images from the rawdata folder when it starts. It turns off due to the fact that it does not find the rawdata folder itself (although it is in the same directory and if I manually started the objectmarker.exe, it would have worked). This is still a mystery to me, but this is a topic for another question.

System.Diagnostics.Process works as it should. For those who have experienced this, first check whether your console application “eats” the required data and whether it is disconnected simply because it cannot retrieve the required data.

  • About the "riddle", read here . In your case, attention to paragraphs 3 and 4. In general, the topic of relative paths has already been discussed many times in various ways. Well, learn any library for logging, so as not to guess what happened, just look =) - rdorn